2#ifndef SEEN_SP_STYLE_INTERNAL_H
3#define SEEN_SP_STYLE_INTERNAL_H
152 virtual void read( gchar
const *str ) = 0;
167 SPIBase const *
const base =
nullptr )
const;
170 SPIBase const *
const base =
nullptr )
const;
194 return id() == rhs.
id();
200 Glib::ustring
const &
name()
const;
218template <SPAttr Id,
class Base>
232 Base *
upcast() {
return static_cast<Base *
>(
this); }
233 Base
const *
upcast()
const {
return static_cast<Base
const *
>(
this); }
248 void read( gchar
const *str )
override;
249 const Glib::ustring
get_value()
const override;
292#define SP_SCALE24_TO_FLOAT(v) ((double) (v) / SP_SCALE24_MAX)
293#define SP_SCALE24_FROM_FLOAT(v) unsigned(((v) * SP_SCALE24_MAX) + .5)
296#define SP_SCALE24_MUL(_v1, _v2) unsigned((double)(_v1) * (_v2) / SP_SCALE24_MAX + .5)
315 operator double()
const {
return SP_SCALE24_TO_FLOAT(
value); }
317 void read( gchar
const *str )
override;
318 const Glib::ustring
get_value()
const override;
324 value = SP_SCALE24_FROM_FLOAT(other);
372 void read( gchar
const *str )
override;
373 const Glib::ustring
get_value()
const override;
387 virtual const Glib::ustring
toString(
bool wname =
false)
const;
414 void read( gchar
const *str )
override;
415 const Glib::ustring
get_value()
const override;
447 void read( gchar
const *str )
override;
448 const Glib::ustring
get_value()
const override;
467 virtual const Glib::ustring
toString()
const;
472 std::map<Glib::ustring, float>
axes;
494 void read( gchar
const *str )
override;
495 const Glib::ustring
get_value()
const override;
547 void read( gchar
const *str )
override;
548 const Glib::ustring
get_value()
const override;
569 void read( gchar
const *str )
override;
570 const Glib::ustring
get_value()
const override;
588 void read( gchar
const *str )
override;
589 const Glib::ustring
get_value()
const override;
607 void read( gchar
const *str )
override;
608 const Glib::ustring
get_value()
const override;
628 void read( gchar
const *str )
override;
629 const Glib::ustring
get_value()
const override;
630 void clear()
override;
647 char const *
value()
const;
666 void read( gchar
const *str )
override;
667 void clear()
override;
670 std::vector<SPShapeReference *>
hrefs;
681 void read(gchar
const *str)
override;
684 const Glib::ustring
get_value()
const override;
711#define SP_STYLE_FILL_SERVER(s) ((const_cast<SPStyle *> (s))->getFillPaintServer())
712#define SP_STYLE_STROKE_SERVER(s) ((const_cast<SPStyle *> (s))->getStrokePaintServer())
730 void read(gchar
const *str)
override;
731 const Glib::ustring
get_value()
const override;
732 void clear()
override;
770 return href &&
href->getObject() !=
nullptr;
797 std::shared_ptr<SPPaintServerReference>
href;
834 void read( gchar
const *str )
override;
835 const Glib::ustring
get_value()
const override;
866 std::array<SPPaintOrderLayer, PAINT_ORDER_LAYERS>
get_layers()
const;
886 void read( gchar
const *str )
override;
887 const Glib::ustring
get_value()
const override;
903 std::vector<double> output;
905 output.push_back(val.computed);
925 void read( gchar
const *str )
override;
926 const Glib::ustring
get_value()
const override;
927 void clear()
override;
960 void read( gchar
const *str )
override;
961 const Glib::ustring
get_value()
const override;
1002 void read( gchar
const *str )
override;
1003 const Glib::ustring
get_value()
const override;
1039 void read( gchar
const *str )
override;
1040 const Glib::ustring
get_value()
const override;
1082 void read( gchar
const *str )
override;
1083 const Glib::ustring
get_value()
const override;
1117 void read( gchar
const *str )
override;
1118 const Glib::ustring
get_value()
const override;
1158 void read( gchar
const *str )
override;
1159 const Glib::ustring
get_value()
const override;
1162 SPIBase const *
const base =
nullptr )
const override;
1212 void read( gchar
const *str )
override;
1213 const Glib::ustring
get_value()
const override;
1248 void read( gchar
const *str )
override;
1249 const Glib::ustring
get_value()
const override;
Lookup dictionary for attributes/properties.
@ INVALID
Must have value 0.
Interface for refcounted XML nodes.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
Virtual base class for all SPStyle internal classes.
bool operator==(const SPIBase &rhs) const
virtual void merge(const SPIBase *const parent)=0
virtual void cascade(const SPIBase *const parent)=0
virtual const Glib::ustring write(guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
Compile this style conditionally into a 'name: value' string suitable for css attrs.
Glib::ustring const & name() const
SPIBase & operator=(const SPIBase &rhs)=default
SPIBase(bool inherits_=true)
char const * important_str() const
virtual bool equals(const SPIBase &rhs) const
void setStylePointer(SPStyle *style_in)
void overwrite(const SPIBase *const other)
void readAttribute(Inkscape::XML::Node *repr)
virtual void read(gchar const *str)=0
virtual ~SPIBase()=default
void readIfUnset(gchar const *str, SPStyleSrc source=SPStyleSrc::STYLE_PROP)
bool shall_write(guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
Check if this property should be written.
virtual const Glib::ustring get_value() const =0
virtual SPAttr id() const
Baseline shift type internal to SPStyle. (This is actually just like SPIFontSize)
void cascade(const SPIBase *const parent) override
~SPIBaselineShift() override=default
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
SPIBaselineShift & operator=(const SPIBaselineShift &rhs)=default
std::optional< Colors::Color > _color
Colors::DocumentCMS const & getCMS() const
void read(gchar const *str, SPStyle &style)
void setColor(Colors::Color const &other)
void read(gchar const *str) override
Colors::Color const & getColor() const
void cascade(const SPIBase *const parent) override
SPIColor & operator=(const SPIColor &rhs)
void merge(const SPIBase *const parent) override
~SPIColor() override=default
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
Filter type internal to SPStyle.
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
SPIDashArray & operator=(const SPIDashArray &rhs)=default
std::vector< SPILength > values
void cascade(const SPIBase *const parent) override
void merge(const SPIBase *const parent) override
std::vector< double > get_computed() const
~SPIDashArray() override=default
void read(gchar const *str) override
void read(gchar const *str) override
~SPIEastAsian() override=default
const Glib::ustring get_value() const override
SPIEnum w/ bits, allows values with multiple key words.
void read(gchar const *str) override
~SPIEnumBits() override=default
const Glib::ustring get_value() const override
SPIEnumBits(Glib::ustring const &name, SPStyleEnum const *enums, unsigned value=0, bool inherits=true)
Enum type internal to SPStyle.
~SPIEnum() override=default
void update_computed()
Update computed from value.
SPIEnum & operator=(const SPIEnum &rhs)
void merge(const SPIBase *const parent) override
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void update_computed_cascade(T const &parent_computed)
Update computed from parent computed.
SPIEnum(T value=T(), bool inherits=true)
void read(gchar const *str) override
void update_value_merge(SPIEnum< T > const &)
Update value from parent.
Filter type internal to SPStyle.
void cascade(const SPIBase *const parent) override
void merge(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
SPIFilter & operator=(const SPIFilter &rhs)=default
Float type internal to SPStyle. (Only 'stroke-miterlimit')
~SPIFloat() override=default
SPIFloat(float value_default=0.0)
void read(gchar const *str) override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
SPIFloat & operator=(const SPIFloat &rhs)=default
bool equals(const SPIBase &rhs) const override
void cascade(const SPIBase *const parent) override
Fontsize type internal to SPStyle (also used by libnrtype/Layout-TNG-Input.cpp).
~SPIFontSize() override=default
SPIFontSize & operator=(const SPIFontSize &rhs)=default
void cascade(const SPIBase *const parent) override
void read(gchar const *str) override
double relative_fraction() const
static float const font_size_default
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
static float const font_size_table[]
Indexed by SP_CSS_FONT_SIZE_blah.
void merge(const SPIBase *const parent) override
Extended length type internal to SPStyle.
~SPIFontVariationSettings() override=default
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
virtual const Glib::ustring toString() const
SPIFontVariationSettings & operator=(const SPIFontVariationSettings &rhs)
void merge(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void cascade(const SPIBase *const parent) override
SPIFontVariationSettings()
std::map< Glib::ustring, float > axes
Font type internal to SPStyle ('font' shorthand)
~SPIFont() override=default
void read(gchar const *str) override
const Glib::ustring get_value() const override
SPIFont & operator=(const SPIFont &rhs)=default
void merge(const SPIBase *const) override
bool equals(const SPIBase &rhs) const override
void cascade(const SPIBase *const) override
Extended length type internal to SPStyle.
void cascade(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
void read(gchar const *str) override
~SPILengthOrNormal() override=default
const Glib::ustring get_value() const override
SPILengthOrNormal & operator=(const SPILengthOrNormal &rhs)=default
SPILengthOrNormal(float value=0)
void merge(const SPIBase *const parent) override
Length type internal to SPStyle.
void cascade(const SPIBase *const parent) override
SPILength & operator=(const SPILength &rhs)=default
const Glib::ustring get_value() const override
void read(gchar const *str) override
~SPILength() override=default
virtual const Glib::ustring toString(bool wname=false) const
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
~SPILigatures() override=default
void read(gchar const *str) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
~SPINumeric() override=default
const Glib::ustring get_value() const override
Paint order type internal to SPStyle.
SPIPaintOrder & operator=(const SPIPaintOrder &rhs)
~SPIPaintOrder() override
unsigned get_order(SPPaintOrderLayer paint_order) const
Return the index of the given paint order.
void read(gchar const *str) override
void cascade(const SPIBase *const parent) override
std::array< SPPaintOrderLayer, PAINT_ORDER_LAYERS > get_layers() const
Get the actual layer order, converting "normal" to layers.
bool layer_set[PAINT_ORDER_LAYERS]
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
SPPaintOrderLayer layer[PAINT_ORDER_LAYERS]
SPIPaintOrder(const SPIPaintOrder &rhs)
void merge(const SPIBase *const parent) override
Paint type internal to SPStyle.
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
bool isPaintserver() const
const Glib::ustring get_value() const override
std::optional< Colors::Color > _color
void cascade(const SPIBase *const parent) override
bool isSameType(SPIPaint const &other) const
virtual void reset(bool init)
std::shared_ptr< SPPaintServerReference > href
Colors::DocumentCMS const & getCMS() const
void setTag(SPObject *tag)
SPPaintOrigin paintSource
SPPaintOrigin paintOrigin
void read(gchar const *str) override
Set SPIPaint object from string.
~SPIPaint() override=default
SPIPaint & operator=(const SPIPaint &rhs)
void setColor(Colors::Color const &other)
Colors::Color const & getColor() const
24 bit data type internal to SPStyle.
const Glib::ustring get_value() const override
static unsigned get_default()
SPIScale24 & operator=(const SPIScale24 &rhs)=default
void read(gchar const *str) override
~SPIScale24() override=default
void set_double(const double &other)
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
SPIScale24(bool inherits=true)
void cascade(const SPIBase *const parent) override
Shapes type internal to SPStyle.
SPIShapes(const SPIShapes &)=delete
bool containsAnyShape(Inkscape::ObjectSet *set)
Check if a Shape object exists in the selection Needed for when user selects multiple objects and.
std::vector< SPShapeReference * > hrefs
void read(gchar const *str) override
String type internal to SPStyle.
char const * get_default_value() const
const Glib::ustring get_value() const override
Value as it should be written to CSS representation, including quotes if needed.
SPIString & operator=(const SPIString &rhs)
SPIString(const SPIString &rhs)
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
SPIString(bool inherits=true)
bool equals(const SPIBase &rhs) const override
void cascade(const SPIBase *const parent) override
char const * value() const
Get value if set, or inherited value, or default value (may be NULL)
Custom stroke properties. Only used for -inkscape-stroke: hairline.
const Glib::ustring get_value() const override
void cascade(const SPIBase *const parent) override
SPIStrokeExtensions & operator=(const SPIStrokeExtensions &rhs)=default
~SPIStrokeExtensions() override=default
void read(gchar const *str) override
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
Text decoration line type internal to SPStyle. THIS SHOULD BE A GENERIC CLASS.
SPITextDecorationLine & operator=(const SPITextDecorationLine &rhs)=default
void read(gchar const *str) override
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
~SPITextDecorationLine() override=default
Text decoration style type internal to SPStyle. THIS SHOULD JUST BE SPIEnum!
SPITextDecorationStyle & operator=(const SPITextDecorationStyle &rhs)=default
~SPITextDecorationStyle() override=default
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
Text decoration type internal to SPStyle.
void cascade(const SPIBase *const parent) override
SPITextDecoration & operator=(const SPITextDecoration &rhs)
SPITextDecoration()=default
~SPITextDecoration() override=default
const Glib::ustring write(guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const override
Compile this style conditionally into a 'name: value' string suitable for css attrs.
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
Vector Effects. THIS SHOULD BE A GENERIC CLASS.
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
~SPIVectorEffect() override=default
bool equals(const SPIBase &rhs) const override
void read(gchar const *str) override
SPIVectorEffect & operator=(const SPIVectorEffect &rhs)=default
void cascade(const SPIBase *const parent) override
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Decorator which overrides SPIBase::id()
static SPAttr static_id()
Base * upcast()
Upcast to the base class.
SPAttr id() const override
Get the attribute enum.
Base const * upcast() const
static char const *const parent
Helper class to stream background task notifications as a series of messages.
C facade to Inkscape::XML::Node.
TODO: insert short description here.
TODO: insert short description here.
float line_through_position
float underline_thickness
float line_through_thickness
SPStyle enums: named public enums that correspond to SVG property values.
@ SP_CSS_FONT_VARIANT_LIGATURES_NORMAL
@ SP_CSS_BASELINE_SHIFT_BASELINE
@ SP_CSS_FONT_SIZE_MEDIUM
@ SP_CSS_FONT_VARIANT_NUMERIC_NORMAL
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_NORMAL
static const unsigned SP_STYLE_FLAG_IFSET(1<< 0)
@ SP_FONT_SIZE_PERCENTAGE
constexpr size_t PAINT_ORDER_LAYERS
@ SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE
@ SP_CSS_PAINT_ORIGIN_CURRENT_COLOR
@ SP_CSS_PAINT_ORIGIN_NORMAL
@ SP_CSS_PAINT_ORIGIN_CONTEXT_FILL
static const unsigned SP_SCALE24_MAX
typename std::underlying_type< SPCSSFontVariantLigatures >::type _SPCSSFontVariantLigatures_int
SPIEnum w/ extra bits.
typename std::underlying_type< SPCSSFontVariantNumeric >::type _SPCSSFontVariantNumeric_int
SPIEnum w/ extra bits.
@ SP_CSS_PAINT_ORDER_STROKE
@ SP_CSS_PAINT_ORDER_MARKER
@ SP_CSS_PAINT_ORDER_FILL
@ SP_CSS_PAINT_ORDER_NORMAL
@ SP_BASELINE_SHIFT_PERCENTAGE
@ SP_BASELINE_SHIFT_LENGTH
@ SP_BASELINE_SHIFT_LITERAL
static const unsigned SP_STYLE_FLAG_ALWAYS(1<< 2)
static const unsigned SP_STYLE_FLAG_IFSRC(1<< 3)
static const unsigned SP_STYLE_FLAG_IFDIFF(1<< 1)
typename std::underlying_type< SPCSSFontVariantEastAsian >::type _SPCSSFontVariantEastAsian_int
SPIEnum w/ extra bits.
void init(int argc, char **argv, Toy *t, int width=600, int height=600)