Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
attribute-rel-util.cpp File Reference

TODO: insert short description here. More...

Go to the source code of this file.

Functions

unsigned int sp_attribute_clean_get_prefs ()
 Get preferences.
 
void sp_attribute_clean_tree (Node *repr)
 Remove or warn about inappropriate attributes and useless stype properties.
 
void sp_attribute_clean_recursive (Node *repr, unsigned int flags)
 Clean recursively over all elements.
 
void sp_attribute_clean_element (Node *repr, unsigned int flags)
 Clean attributes on an element.
 
void sp_attribute_clean_style (Node *repr, unsigned int flags)
 Clean CSS style on an element.
 
Glib::ustring sp_attribute_clean_style (Node *repr, gchar const *string, unsigned int flags)
 Clean CSS style on an element.
 
void sp_attribute_clean_style (Node *repr, SPCSSAttr *css, unsigned int flags)
 Clean CSS style on an element.
 
void sp_attribute_purge_default_style (SPCSSAttr *css, unsigned int flags)
 Remove CSS style properties with default values.
 
bool sp_attribute_check_attribute (Glib::ustring const &element, Glib::ustring const &id, Glib::ustring const &attribute, bool warn)
 Check one attribute on an element.
 
bool sp_is_valid_svg_path_d (Glib::ustring const &d)
 Check whether the 'd' attribute on a <path> element parses correctly.
 

Detailed Description

TODO: insert short description here.

Definition in file attribute-rel-util.cpp.

Function Documentation

◆ sp_attribute_check_attribute()

bool sp_attribute_check_attribute ( Glib::ustring const &  element,
Glib::ustring const &  id,
Glib::ustring const &  attribute,
bool  warn 
)

◆ sp_attribute_clean_element()

void sp_attribute_clean_element ( Node repr,
unsigned int  flags 
)

◆ sp_attribute_clean_get_prefs()

◆ sp_attribute_clean_recursive()

void sp_attribute_clean_recursive ( Node repr,
unsigned int  flags 
)

◆ sp_attribute_clean_style() [1/3]

Glib::ustring sp_attribute_clean_style ( Node repr,
gchar const *  string,
unsigned int  flags 
)

◆ sp_attribute_clean_style() [2/3]

void sp_attribute_clean_style ( Node repr,
SPCSSAttr css,
unsigned int  flags 
)

Clean CSS style on an element.

Clean style properties for one CSS.

  1. Is a style property appropriate on the given element? e.g, font-size is useless on <svg:rect>
  2. Is the value of the style property useful? Is it the same as the parent and it inherits? Is it the default value (and the property on the parent is not set or does not inherit)?

Definition at line 187 of file attribute-rel-util.cpp.

References Inkscape::XML::Node::attribute(), Inkscape::XML::Node::attributeList(), css, SPAttributeRelCSS::findIfDefault(), SPAttributeRelCSS::findIfInherit(), SPAttributeRelCSS::findIfValid(), Inkscape::XML::Node::name(), Inkscape::XML::Node::parent(), SP_ATTRCLEAN_DEFAULT_REMOVE, SP_ATTRCLEAN_DEFAULT_WARN, SP_ATTRCLEAN_STYLE_REMOVE, SP_ATTRCLEAN_STYLE_WARN, sp_repr_css_attr_inherited(), and sp_repr_css_set_property().

◆ sp_attribute_clean_style() [3/3]

◆ sp_attribute_clean_tree()

void sp_attribute_clean_tree ( Node repr)

Remove or warn about inappropriate attributes and useless stype properties.

Remove or warn about inappropriate attributes and useless style properties.

repr: the root node in a document or any other node.

Definition at line 67 of file attribute-rel-util.cpp.

References sp_attribute_clean_get_prefs(), and sp_attribute_clean_recursive().

Referenced by sp_repr_do_read(), and sp_repr_write_stream_root_element().

◆ sp_attribute_purge_default_style()

void sp_attribute_purge_default_style ( SPCSSAttr css,
unsigned int  flags 
)

Remove CSS style properties with default values.

Definition at line 269 of file attribute-rel-util.cpp.

References css, SPAttributeRelCSS::findIfDefault(), SP_ATTRCLEAN_DEFAULT_REMOVE, SP_ATTRCLEAN_DEFAULT_WARN, and sp_repr_css_set_property().

Referenced by Inkscape::Preferences::mergeStyle().

◆ sp_is_valid_svg_path_d()

bool sp_is_valid_svg_path_d ( Glib::ustring const &  d)

Check whether the 'd' attribute on a <path> element parses correctly.

Parameters
dThe value of the 'd' attribute.
Returns
false if the value causes a parser error, true otherwise.

A PathSink going straight to /dev/null

Definition at line 336 of file attribute-rel-util.cpp.

References Geom::PathSink::feed().