diff --git a/src/style.h b/src/style.h
index 2e928224b932518b740c02017ab6d11f570d4bbd..d5ccc4901ac5553d0fe6c29db161d30894a43d77 100644 (file)
--- a/src/style.h
+++ b/src/style.h
/** \file
* SPStyle - a style object for SPItem objects
- *
- * Authors:
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
#define SP_OBJECT_STYLE_FILL_SERVER(o) (SP_OBJECT (o)->style->getFillPaintServer())
#define SP_OBJECT_STYLE_STROKE_SERVER(o) (SP_OBJECT (o)->style->getStrokePaintServer())
-enum {
- SP_PAINT_TYPE_NONE,
- SP_PAINT_TYPE_COLOR,
- SP_PAINT_TYPE_PAINTSERVER,
- SP_PAINT_TYPE_IMPOSSIBLE
-};
-
class SVGICCColor;
/// Paint type internal to SPStyle.
unsigned set : 1;
unsigned inherit : 1;
unsigned currentcolor : 1;
- unsigned type : 2;
+ unsigned int colorSet : 1;
+ unsigned int noneSet : 1;
struct {
- SPPaintServerReference *href;
- SPColor color;
- SVGICCColor *iccColor;
+ SPPaintServerReference *href;
+ SPColor color;
} value;
+
+
+ bool isSet() const { return true; /* set || colorSet*/}
+ bool isSameType( SPIPaint const & other ) const {return (isPaintserver() == other.isPaintserver()) && (colorSet == other.colorSet) && (currentcolor == other.currentcolor);}
+
+ bool isNoneSet() const {return noneSet;}
+
+ bool isNone() const {return !currentcolor && !colorSet && !isPaintserver();} // TODO refine
+ bool isColor() const {return colorSet && !isPaintserver();}
+ bool isPaintserver() const {return value.href && value.href->getObject();}
+
+ void clear();
+
+ void setColor( float r, float g, float b ) {value.color.set( r, g, b ); colorSet = true;}
+ void setColor( guint32 val ) {value.color.set( val ); colorSet = true;}
+ void setColor( SPColor const& color ) {value.color = color; colorSet = true;}
};
/// Filter type internal to SPStyle
void sp_style_read_from_object(SPStyle *style, SPObject *object);
-void sp_style_read_from_repr(SPStyle *style, Inkscape::XML::Node *repr);
+void sp_style_read_from_prefs(SPStyle *style, Glib::ustring const &path);
void sp_style_merge_from_style_string(SPStyle *style, gchar const *p);
/* CSS font properties */
SPIString font_family;
+ /* Full font name, as font_factory::ConstructFontSpecification would give */
+ SPIString font_specification;
+
/** \todo fixme: The 'font' property is ugly, and not working (lauris) */
SPIString font;
};