summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-10-28 11:38:42 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-10-28 11:38:42 +0000
commit7542c092240f8ef0c4ae79f3f7efa7f6f4dd7a6c (patch)
tree1ab4e29d89f0d0407d8b05d8c2848580cf9e8925
parentrefactor: Eliminate SPIEnum::_name (diff)
downloadinkscape-7542c092240f8ef0c4ae79f3f7efa7f6f4dd7a6c.tar.gz
inkscape-7542c092240f8ef0c4ae79f3f7efa7f6f4dd7a6c.zip
refactor: clean up SPI constructors
-rw-r--r--src/extension/internal/emf-inout.cpp6
-rw-r--r--src/extension/internal/wmf-inout.cpp2
-rw-r--r--src/style-internal.cpp16
-rw-r--r--src/style-internal.h163
-rw-r--r--src/style.cpp143
5 files changed, 126 insertions, 204 deletions
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 27c9cc181..42291a8fb 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -1093,7 +1093,7 @@ Emf::select_pen(PEMF_CALLBACK_DATA d, int index)
case U_PS_DASHDOT:
case U_PS_DASHDOTDOT:
{
- SPILength spilength("temp", 1);
+ SPILength spilength(1.f);
int penstyle = (pEmr->lopn.lopnStyle & U_PS_STYLE_MASK);
if (!d->dc[d->level].style.stroke_dasharray.values.empty() &&
(d->level == 0 || (d->level > 0 && d->dc[d->level].style.stroke_dasharray !=
@@ -1189,7 +1189,7 @@ Emf::select_extpen(PEMF_CALLBACK_DATA d, int index)
d->dc[d->level].style.stroke_dasharray.values.clear();
for (unsigned int i=0; i<pEmr->elp.elpNumEntries; i++) {
double dash_length = pix_to_abs_size( d, pEmr->elp.elpStyleEntry[i] );
- d->dc[d->level].style.stroke_dasharray.values.emplace_back("temp", dash_length);
+ d->dc[d->level].style.stroke_dasharray.values.emplace_back(dash_length);
}
d->dc[d->level].style.stroke_dasharray.set = true;
} else {
@@ -1208,7 +1208,7 @@ Emf::select_extpen(PEMF_CALLBACK_DATA d, int index)
(d->level == 0 || (d->level > 0 && d->dc[d->level].style.stroke_dasharray !=
d->dc[d->level - 1].style.stroke_dasharray)))
d->dc[d->level].style.stroke_dasharray.values.clear();
- SPILength spilength("temp");
+ SPILength spilength;
if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
spilength.setDouble(3);
d->dc[d->level].style.stroke_dasharray.values.push_back(spilength);
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index b8c5d6341..e5e22798c 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -985,7 +985,7 @@ Wmf::select_pen(PWMF_CALLBACK_DATA d, int index)
case U_PS_DASHDOTDOT:
{
int penstyle = (up.Style & U_PS_STYLE_MASK);
- SPILength spilength("temp", 1);
+ SPILength spilength(1.f);
if (!d->dc[d->level].style.stroke_dasharray.values.empty() &&
(d->level == 0 || (d->level > 0 && d->dc[d->level].style.stroke_dasharray !=
d->dc[d->level - 1].style.stroke_dasharray)))
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index 5a36291bc..18be536f3 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -1939,7 +1939,7 @@ SPIDashArray::read( gchar const *str ) {
bool LineSolid = true;
for (auto token : tokens) {
- SPILength spilength("temp");
+ SPILength spilength;
spilength.read(token.c_str());
if (spilength.value > 0.00000001)
LineSolid = false;
@@ -2029,7 +2029,7 @@ SPIFontSize::read( gchar const *str ) {
/* Invalid */
return;
} else {
- SPILength length("temp");
+ SPILength length;
length.set = false;
length.read( str );
if( length.set ) {
@@ -2282,7 +2282,7 @@ SPIFont::read( gchar const *str ) {
} else {
// Try to parse each property in turn
- decltype(style->font_style) test_style("font-style", enum_font_style);
+ decltype(style->font_style) test_style;
test_style.read( lparam.c_str() );
if( test_style.set ) {
style->font_style = test_style;
@@ -2290,7 +2290,7 @@ SPIFont::read( gchar const *str ) {
}
// font-variant (Note: only CSS2.1 value small-caps is valid in shortcut.)
- decltype(style->font_variant) test_variant("font-variant", enum_font_variant);
+ decltype(style->font_variant) test_variant;
test_variant.read( lparam.c_str() );
if( test_variant.set ) {
style->font_variant = test_variant;
@@ -2298,7 +2298,7 @@ SPIFont::read( gchar const *str ) {
}
// font-weight
- decltype(style->font_weight) test_weight("font-weight", enum_font_weight);
+ decltype(style->font_weight) test_weight;
test_weight.read( lparam.c_str() );
if( test_weight.set ) {
style->font_weight = test_weight;
@@ -2306,7 +2306,7 @@ SPIFont::read( gchar const *str ) {
}
// font-stretch (added in CSS 3 Fonts)
- decltype(style->font_stretch) test_stretch("font-stretch", enum_font_stretch);
+ decltype(style->font_stretch) test_stretch;
test_stretch.read( lparam.c_str() );
if( test_stretch.set ) {
style->font_stretch = test_stretch;
@@ -2407,7 +2407,7 @@ SPIBaselineShift::read( gchar const *str ) {
/* Invalid */
return;
} else {
- SPILength length( "temp" );
+ SPILength length;
length.read( str );
set = length.set;
inherit = length.inherit;
@@ -2819,7 +2819,7 @@ SPITextDecoration::read( gchar const *str ) {
// one is used ???? then why break on set?
// This could certainly be designed better
- decltype(style->text_decoration_color) test_color("text-decoration-color");
+ decltype(style->text_decoration_color) test_color;
test_color.setStylePointer( style );
test_color.read( "currentColor" ); // Default value
test_color.set = false;
diff --git a/src/style-internal.h b/src/style-internal.h
index b8b493d0c..d04617387 100644
--- a/src/style-internal.h
+++ b/src/style-internal.h
@@ -126,8 +126,8 @@ class SPIBase
{
public:
- SPIBase()
- : inherits(true),
+ SPIBase(bool inherits_ = true)
+ : inherits(inherits_),
set(false),
inherit(false),
important(false),
@@ -135,13 +135,6 @@ public:
style(nullptr)
{}
- // TODO remove name constructor
- SPIBase(Glib::ustring const &, bool inherits_ = true)
- : SPIBase()
- {
- inherits = inherits_;
- }
-
virtual ~SPIBase()
= default;
@@ -258,11 +251,8 @@ class SPIFloat : public SPIBase
{
public:
- SPIFloat() = default;
-
- SPIFloat( Glib::ustring const &name, float value_default = 0.0 )
- : SPIBase( name ),
- value(value_default),
+ SPIFloat(float value_default = 0.0 )
+ : value(value_default),
value_default(value_default)
{}
@@ -326,16 +316,12 @@ static const unsigned SP_SCALE24_MAX = 0xff0000;
// Opacity does not inherit but stroke-opacity and fill-opacity do.
class SPIScale24 : public SPIBase
{
+ static unsigned get_default() { return SP_SCALE24_MAX; }
public:
- SPIScale24()
- : value(0)
- {}
-
- SPIScale24( Glib::ustring const &name, unsigned value = 0, bool inherits = true )
- : SPIBase( name, inherits ),
- value(value),
- value_default(value)
+ SPIScale24(bool inherits = true )
+ : SPIBase(inherits),
+ value(get_default())
{}
~SPIScale24() override
@@ -345,7 +331,7 @@ public:
const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
- value = value_default;
+ value = get_default();
}
void cascade( const SPIBase* const parent ) override;
@@ -362,9 +348,6 @@ public:
// To do: make private
public:
unsigned value : 24;
-
-private:
- unsigned value_default : 24;
};
@@ -389,15 +372,8 @@ class SPILength : public SPIBase
{
public:
- SPILength()
+ SPILength(float value = 0)
: unit(SP_CSS_UNIT_NONE),
- value(0),
- computed(0)
- {}
-
- SPILength( Glib::ustring const &name, float value = 0 )
- : SPIBase( name ),
- unit(SP_CSS_UNIT_NONE),
value(value),
computed(value),
value_default(value)
@@ -429,11 +405,11 @@ public:
// To do: make private
public:
unsigned unit : 4;
- float value;
- float computed;
+ float value = 0.f;
+ float computed = 0.f;
private:
- float value_default;
+ float value_default = 0.f;
};
@@ -443,12 +419,8 @@ class SPILengthOrNormal : public SPILength
{
public:
- SPILengthOrNormal()
- : normal(true)
- {}
-
- SPILengthOrNormal( Glib::ustring const &name, float value = 0 )
- : SPILength( name, value ),
+ SPILengthOrNormal(float value = 0)
+ : SPILength(value),
normal(true)
{}
@@ -488,11 +460,6 @@ public:
: normal(true)
{}
- SPIFontVariationSettings( Glib::ustring const &name )
- : SPIBase( name ),
- normal(true)
- {}
-
~SPIFontVariationSettings() override
= default;
@@ -536,10 +503,8 @@ class SPIEnum : public SPIBase
{
public:
- SPIEnum() = delete;
-
- SPIEnum( Glib::ustring const &name, SPStyleEnum const *enums, T value = T(), bool inherits = true ) :
- SPIBase( name, inherits ),
+ SPIEnum(T value = T(), bool inherits = true) :
+ SPIBase(inherits),
value(value),
value_default(value)
{
@@ -620,10 +585,8 @@ class SPILigatures : public SPIEnum<_SPCSSFontVariantLigatures_int>
{
public:
- SPILigatures() = delete;
-
- SPILigatures( Glib::ustring const &name, SPStyleEnum const *enums) :
- SPIEnum<_SPCSSFontVariantLigatures_int>( name, enums, SP_CSS_FONT_VARIANT_LIGATURES_NORMAL )
+ SPILigatures() :
+ SPIEnum<_SPCSSFontVariantLigatures_int>(SP_CSS_FONT_VARIANT_LIGATURES_NORMAL)
{}
~SPILigatures() override
@@ -641,10 +604,8 @@ class SPINumeric : public SPIEnum<_SPCSSFontVariantNumeric_int>
{
public:
- SPINumeric() = delete;
-
- SPINumeric( Glib::ustring const &name, SPStyleEnum const *enums) :
- SPIEnum<_SPCSSFontVariantNumeric_int>( name, enums, SP_CSS_FONT_VARIANT_NUMERIC_NORMAL )
+ SPINumeric() :
+ SPIEnum<_SPCSSFontVariantNumeric_int>(SP_CSS_FONT_VARIANT_NUMERIC_NORMAL)
{}
~SPINumeric() override
@@ -662,10 +623,8 @@ class SPIEastAsian : public SPIEnum<_SPCSSFontVariantEastAsian_int>
{
public:
- SPIEastAsian() = delete;
-
- SPIEastAsian( Glib::ustring const &name, SPStyleEnum const *enums) :
- SPIEnum<_SPCSSFontVariantEastAsian_int>( name, enums, SP_CSS_FONT_VARIANT_EAST_ASIAN_NORMAL )
+ SPIEastAsian() :
+ SPIEnum<_SPCSSFontVariantEastAsian_int>(SP_CSS_FONT_VARIANT_EAST_ASIAN_NORMAL)
{}
~SPIEastAsian() override
@@ -682,13 +641,10 @@ class SPIString : public SPIBase
{
public:
- SPIString() = default;
-
// TODO probably want to avoid gchar* and c-style strings.
- SPIString( Glib::ustring const &name, gchar const* value_default_in = nullptr )
- : SPIBase( name ),
- value(nullptr),
- value_default(value_default_in ? g_strdup(value_default_in) : nullptr)
+ SPIString(gchar const *value_default_in = nullptr, bool inherits = true)
+ : SPIBase(inherits)
+ , value_default(g_strdup(value_default_in))
{}
~SPIString() override {
@@ -729,13 +685,9 @@ class SPIShapes : public SPIString
{
public:
- SPIShapes()
- : SPIString()
- {}
-
// TODO probably want to avoid gchar* and c-style strings.
- SPIShapes( Glib::ustring const &name, gchar const* value_default_in = nullptr )
- : SPIString( name, value_default_in )
+ SPIShapes(gchar const *value_default_in = nullptr)
+ : SPIString(value_default_in)
{}
void read( gchar const *str ) override;
@@ -749,18 +701,13 @@ class SPIColor : public SPIBase
{
public:
- SPIColor()
- : currentcolor(false)
+ SPIColor(bool inherits = true)
+ : SPIBase(inherits)
+ , currentcolor(false)
{
value.color.set(0);
}
- SPIColor( Glib::ustring const &name, bool inherits = true )
- : SPIBase( name, inherits ),
- currentcolor(false) {
- value.color.set(0);
- }
-
~SPIColor() override
= default;
@@ -833,14 +780,6 @@ public:
clear();
}
- SPIPaint( Glib::ustring const &name )
- : SPIBase( name ),
- colorSet(false),
- noneSet(false) {
- value.href = nullptr;
- clear(); // Sets defaults
- }
-
~SPIPaint() override; // Clear and delete href.
void read( gchar const *str ) override;
virtual void read( gchar const *str, SPStyle &style, SPDocument *document = nullptr);
@@ -931,9 +870,7 @@ class SPIPaintOrder : public SPIBase
{
public:
- SPIPaintOrder()
- : SPIBase( "paint-order" ),
- value(nullptr) {
+ SPIPaintOrder() {
this->clear();
}
@@ -976,7 +913,7 @@ public:
public:
SPPaintOrderLayer layer[PAINT_ORDER_LAYERS];
bool layer_set[PAINT_ORDER_LAYERS];
- gchar *value; // Raw string
+ gchar *value = nullptr; // Raw string
};
@@ -985,9 +922,7 @@ class SPIDashArray : public SPIBase
{
public:
- SPIDashArray()
- : SPIBase( "stroke-dasharray" )
- {} // Only one instance of SPIDashArray
+ SPIDashArray() = default;
~SPIDashArray() override
= default;
@@ -1020,8 +955,7 @@ class SPIFilter : public SPIBase
public:
SPIFilter()
- : SPIBase( "filter", false ),
- href(nullptr)
+ : SPIBase(false)
{}
~SPIFilter() override;
@@ -1040,7 +974,7 @@ public:
// To do: make private
public:
- SPFilterReference *href;
+ SPFilterReference *href = nullptr;
};
@@ -1056,8 +990,7 @@ class SPIFontSize : public SPIBase
{
public:
- SPIFontSize()
- : SPIBase( "font-size" ) {
+ SPIFontSize() {
this->clear();
}
@@ -1104,9 +1037,7 @@ class SPIFont : public SPIBase
{
public:
- SPIFont()
- : SPIBase( "font" )
- {}
+ SPIFont() = default;
~SPIFont() override
= default;
@@ -1144,7 +1075,7 @@ class SPIBaselineShift : public SPIBase
public:
SPIBaselineShift()
- : SPIBase( "baseline-shift", false ) {
+ : SPIBase(false) {
this->clear();
}
@@ -1190,8 +1121,7 @@ class SPITextDecorationLine : public SPIBase
{
public:
- SPITextDecorationLine()
- : SPIBase( "text-decoration-line" ) {
+ SPITextDecorationLine() {
this->clear();
}
@@ -1229,8 +1159,7 @@ class SPITextDecorationStyle : public SPIBase
{
public:
- SPITextDecorationStyle()
- : SPIBase( "text-decoration-style" ) {
+ SPITextDecorationStyle() {
this->clear();
}
@@ -1276,10 +1205,7 @@ class SPITextDecoration : public SPIBase
{
public:
- SPITextDecoration()
- : SPIBase( "text-decoration" ),
- style_td( nullptr )
- {}
+ SPITextDecoration() = default;
~SPITextDecoration() override
= default;
@@ -1309,7 +1235,7 @@ public:
}
public:
- SPStyle* style_td; // Style to be used for drawing CSS2 text decorations
+ SPStyle* style_td = nullptr; // Style to be used for drawing CSS2 text decorations
};
@@ -1332,8 +1258,7 @@ class SPIVectorEffect : public SPIBase
{
public:
- SPIVectorEffect()
- : SPIBase( "vector-effect" ) {
+ SPIVectorEffect() {
this->clear();
inherits = false;
}
diff --git a/src/style.cpp b/src/style.cpp
index 5bb0457fc..bef6718da 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -259,9 +259,6 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// glyph-orientation-horizontal, glyph-orientation-vertical, kerning, lighting-color,
// pointer-events, unicode-bidi
- // For enums: property( name, enumeration, default value , inherits = true );
- // For scale24: property( name, default value = 0, inherits = true );
-
// 'font', 'font-size', and 'font-family' must come first as other properties depend on them
// for calculated values (through 'em' and 'ex'). ('ex' is currently not read.)
// The following properties can depend on 'em' and 'ex':
@@ -274,121 +271,121 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// SVG 2 attributes promoted to properties. (When geometry properties are added, move after font.)
- d( "d" ), // SPIString Not inherited!
+ d( nullptr, false), // SPIString Not inherited!
// Font related properties and 'font' shorthand
- font_style( "font-style", enum_font_style, SP_CSS_FONT_STYLE_NORMAL ),
- font_variant( "font-variant", enum_font_variant, SP_CSS_FONT_VARIANT_NORMAL ),
- font_weight( "font-weight", enum_font_weight, SP_CSS_FONT_WEIGHT_NORMAL ),
- font_stretch( "font-stretch", enum_font_stretch, SP_CSS_FONT_STRETCH_NORMAL ),
+ font_style( SP_CSS_FONT_STYLE_NORMAL),
+ font_variant( SP_CSS_FONT_VARIANT_NORMAL),
+ font_weight( SP_CSS_FONT_WEIGHT_NORMAL),
+ font_stretch( SP_CSS_FONT_STRETCH_NORMAL),
font_size(),
- line_height( "line-height", 1.25 ), // SPILengthOrNormal
- font_family( "font-family", "sans-serif" ), // SPIString w/default
+ line_height( 1.25 ), // SPILengthOrNormal
+ font_family( "sans-serif"), // SPIString w/default
font(), // SPIFont
- font_specification( "-inkscape-font-specification" ), // SPIString
+ font_specification( ), // SPIString
// Font variants (Features)
- font_variant_ligatures( "font-variant-ligatures", enum_font_variant_ligatures ),
- font_variant_position( "font-variant-position", enum_font_variant_position, SP_CSS_FONT_VARIANT_POSITION_NORMAL ),
- font_variant_caps( "font-variant-caps", enum_font_variant_caps, SP_CSS_FONT_VARIANT_CAPS_NORMAL ),
- font_variant_numeric( "font-variant-numeric", enum_font_variant_numeric ),
- font_variant_alternates("font-variant-alternates", enum_font_variant_alternates, SP_CSS_FONT_VARIANT_ALTERNATES_NORMAL ),
- font_variant_east_asian("font-variant-east-asian", enum_font_variant_east_asian ),
- font_feature_settings( "font-feature-settings", "normal" ),
+ font_variant_ligatures( ),
+ font_variant_position( SP_CSS_FONT_VARIANT_POSITION_NORMAL),
+ font_variant_caps( SP_CSS_FONT_VARIANT_CAPS_NORMAL),
+ font_variant_numeric( ),
+ font_variant_alternates(SP_CSS_FONT_VARIANT_ALTERNATES_NORMAL),
+ font_variant_east_asian(),
+ font_feature_settings( "normal"),
// Variable Fonts
- font_variation_settings( "font-variation-settings" ), // SPIFontVariationSettings
+ font_variation_settings(), // SPIFontVariationSettings
// Text related properties
- text_indent( "text-indent", 0.0 ), // SPILength
- text_align( "text-align", enum_text_align, SP_CSS_TEXT_ALIGN_START ),
+ text_indent( ), // SPILength
+ text_align( SP_CSS_TEXT_ALIGN_START),
- letter_spacing( "letter-spacing", 0.0 ), // SPILengthOrNormal
- word_spacing( "word-spacing", 0.0 ), // SPILengthOrNormal
- text_transform( "text-transform", enum_text_transform, SP_CSS_TEXT_TRANSFORM_NONE ),
+ letter_spacing( ), // SPILengthOrNormal
+ word_spacing( ), // SPILengthOrNormal
+ text_transform( SP_CSS_TEXT_TRANSFORM_NONE),
- direction( "direction", enum_direction, SP_CSS_DIRECTION_LTR ),
- writing_mode( "writing-mode", enum_writing_mode, SP_CSS_WRITING_MODE_LR_TB ),
- text_orientation( "text-orientation",enum_text_orientation,SP_CSS_TEXT_ORIENTATION_MIXED ),
- dominant_baseline("dominant-baseline",enum_baseline, SP_CSS_BASELINE_AUTO ),
+ direction( SP_CSS_DIRECTION_LTR),
+ writing_mode( SP_CSS_WRITING_MODE_LR_TB),
+ text_orientation( SP_CSS_TEXT_ORIENTATION_MIXED),
+ dominant_baseline( SP_CSS_BASELINE_AUTO),
baseline_shift(),
- text_anchor( "text-anchor", enum_text_anchor, SP_CSS_TEXT_ANCHOR_START ),
- white_space( "white-space", enum_white_space, SP_CSS_WHITE_SPACE_NORMAL ),
+ text_anchor( SP_CSS_TEXT_ANCHOR_START),
+ white_space( SP_CSS_WHITE_SPACE_NORMAL),
// SVG 2 Text Wrapping
- shape_inside( "shape-inside" ), // SPIString
- shape_subtract( "shape-subtract" ), // SPIString
- shape_padding( "shape-padding", 0.0 ), // SPILength for now
- shape_margin( "shape-margin", 0.0 ), // SPILength for now
- inline_size( "inline-size", 0.0 ), // SPILength for now
+ shape_inside( ), // SPIString
+ shape_subtract( ), // SPIString
+ shape_padding( ), // SPILength for now
+ shape_margin( ), // SPILength for now
+ inline_size( ), // SPILength for now
text_decoration(),
text_decoration_line(),
text_decoration_style(),
- text_decoration_color( "text-decoration-color" ), // SPIColor
- text_decoration_fill( "text-decoration-fill" ), // SPIPaint
- text_decoration_stroke("text-decoration-stroke" ), // SPIPaint
+ text_decoration_color( ), // SPIColor
+ text_decoration_fill( ), // SPIPaint
+ text_decoration_stroke( ), // SPIPaint
// General visual properties
- clip_rule( "clip-rule", enum_clip_rule, SP_WIND_RULE_NONZERO ),
- display( "display", enum_display, SP_CSS_DISPLAY_INLINE, false ),
- overflow( "overflow", enum_overflow, SP_CSS_OVERFLOW_VISIBLE, false ),
- visibility( "visibility", enum_visibility, SP_CSS_VISIBILITY_VISIBLE ),
- opacity( "opacity", SP_SCALE24_MAX, false ),
+ clip_rule( SP_WIND_RULE_NONZERO),
+ display( SP_CSS_DISPLAY_INLINE, false),
+ overflow( SP_CSS_OVERFLOW_VISIBLE, false),
+ visibility( SP_CSS_VISIBILITY_VISIBLE),
+ opacity( false),
- isolation( "isolation", enum_isolation, SP_CSS_ISOLATION_AUTO ),
- mix_blend_mode( "mix-blend-mode", enum_blend_mode, SP_CSS_BLEND_NORMAL ),
+ isolation( SP_CSS_ISOLATION_AUTO),
+ mix_blend_mode( SP_CSS_BLEND_NORMAL),
paint_order(), // SPIPaintOrder
// Color properties
- color( "color" ), // SPIColor
- color_interpolation( "color-interpolation", enum_color_interpolation, SP_CSS_COLOR_INTERPOLATION_SRGB),
- color_interpolation_filters("color-interpolation-filters", enum_color_interpolation, SP_CSS_COLOR_INTERPOLATION_LINEARRGB),
+ color( ), // SPIColor
+ color_interpolation( SP_CSS_COLOR_INTERPOLATION_SRGB),
+ color_interpolation_filters(SP_CSS_COLOR_INTERPOLATION_LINEARRGB),
// Solid color properties
- solid_color( "solid-color" ), // SPIColor
- solid_opacity( "solid-opacity", SP_SCALE24_MAX ),
+ solid_color( ), // SPIColor
+ solid_opacity( ),
// Vector effects
vector_effect(),
// Fill properties
- fill( "fill" ), // SPIPaint
- fill_opacity( "fill-opacity", SP_SCALE24_MAX ),
- fill_rule( "fill-rule", enum_fill_rule, SP_WIND_RULE_NONZERO ),
+ fill( ), // SPIPaint
+ fill_opacity( ),
+ fill_rule( SP_WIND_RULE_NONZERO),
// Stroke properites
- stroke( "stroke" ), // SPIPaint
- stroke_width( "stroke-width", 1.0 ), // SPILength
- stroke_linecap( "stroke-linecap", enum_stroke_linecap, SP_STROKE_LINECAP_BUTT ),
- stroke_linejoin( "stroke-linejoin", enum_stroke_linejoin, SP_STROKE_LINEJOIN_MITER ),
- stroke_miterlimit("stroke-miterlimit", 4 ), // SPIFloat (only use of float!)
+ stroke( ), // SPIPaint
+ stroke_width( 1.0), // SPILength
+ stroke_linecap( SP_STROKE_LINECAP_BUTT),
+ stroke_linejoin( SP_STROKE_LINEJOIN_MITER),
+ stroke_miterlimit( 4), // SPIFloat (only use of float!)
stroke_dasharray(), // SPIDashArray
- stroke_dashoffset("stroke-dashoffset", 0.0 ), // SPILength for now
+ stroke_dashoffset( ), // SPILength for now
- stroke_opacity( "stroke-opacity", SP_SCALE24_MAX ),
+ stroke_opacity( ),
- marker( "marker" ), // SPIString
- marker_start( "marker-start" ), // SPIString
- marker_mid( "marker-mid" ), // SPIString
- marker_end( "marker-end" ), // SPIString
+ marker( ), // SPIString
+ marker_start( ), // SPIString
+ marker_mid( ), // SPIString
+ marker_end( ), // SPIString
// Filter properties
filter(),
- filter_blend_mode("filter-blend-mode", enum_blend_mode, SP_CSS_BLEND_NORMAL),
- filter_gaussianBlur_deviation( "filter-gaussianBlur-deviation", 0.0 ), // SPILength
- enable_background("enable-background", enum_enable_background, SP_CSS_BACKGROUND_ACCUMULATE, false),
+ filter_blend_mode( SP_CSS_BLEND_NORMAL),
+ filter_gaussianBlur_deviation(), // SPILength
+ enable_background( SP_CSS_BACKGROUND_ACCUMULATE, false),
// Rendering hint properties
- color_rendering( "color-rendering", enum_color_rendering, SP_CSS_COLOR_RENDERING_AUTO),
- image_rendering( "image-rendering", enum_image_rendering, SP_CSS_IMAGE_RENDERING_AUTO),
- shape_rendering( "shape-rendering", enum_shape_rendering, SP_CSS_SHAPE_RENDERING_AUTO),
- text_rendering( "text-rendering", enum_text_rendering, SP_CSS_TEXT_RENDERING_AUTO ),
+ color_rendering( SP_CSS_COLOR_RENDERING_AUTO),
+ image_rendering( SP_CSS_IMAGE_RENDERING_AUTO),
+ shape_rendering( SP_CSS_SHAPE_RENDERING_AUTO),
+ text_rendering( SP_CSS_TEXT_RENDERING_AUTO),
// Stop color and opacity
- stop_color("stop-color", false), // SPIColor, does not inherit
- stop_opacity("stop-opacity", SP_SCALE24_MAX, false) // Does not inherit
+ stop_color( false), // SPIColor, does not inherit
+ stop_opacity( false) // Does not inherit
{
// std::cout << "SPStyle::SPStyle( SPDocument ): Entrance: (" << _count << ")" << std::endl;
// std::cout << " Document: " << (document_in?"present":"null") << std::endl;