19#include <glibmm/quark.h>
24#define SP_SODIPODI_NS_URI "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
25#define SP_BROKEN_SODIPODI_NS_URI "http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
26#define SP_INKSCAPE_NS_URI "http://www.inkscape.org/namespaces/inkscape"
27#define SP_XLINK_NS_URI "http://www.w3.org/1999/xlink"
28#define SP_SVG_NS_URI "http://www.w3.org/2000/svg"
29#define SP_RDF_NS_URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
30#define SP_CC_NS_URI "http://creativecommons.org/ns#"
31#define SP_OLD_CC_NS_URI "http://web.resource.org/cc/"
32#define SP_DC_NS_URI "http://purl.org/dc/elements/1.1/"
58 int indent_level,
bool add_whitespace, Glib::QueryQuark elide_prefix,
59 int inlineattrs,
int indent,
60 char const *old_href_base =
nullptr,
61 char const *new_href_base =
nullptr);
63 Glib::QueryQuark elide_prefix,
int inlineattrs,
int indent,
64 char const *old_href_base =
nullptr,
char const *new_href_base =
nullptr);
70 char const *default_ns =
nullptr,
bool compress =
false,
71 char const *old_href_base =
nullptr,
72 char const *new_href_base =
nullptr);
76 char const *default_ns,
77 char const *old_base,
char const *new_base_filename);
165 Glib::ustring
const &property,
166 Glib::ustring
const &value,
195template <
typename Visitor>
197 if (!visitor(
node)) {
218template <
typename Visitor>
220 if (!visitor(a, b)) {
224 ac !=
nullptr && bc !=
nullptr;
225 ac = ac->next(), bc = bc->next()) {
pair< double, double > Point
This interface and its descendants are for unicode character-oriented output.
Interface for refcounted XML nodes.
void sp_repr_visit_descendants(Inkscape::XML::Node *node, Visitor visitor)
Visit all descendants recursively.
virtual Node * parent()=0
Get the parent of this node.
Inkscape::XML::Node * sp_repr_lookup_name(Inkscape::XML::Node *repr, char const *name, int maxdepth=-1)
Find an element node with the given name.
virtual char const * name() const =0
Get the name of the element node.
void sp_repr_visit_descendants(Inkscape::XML::Node *a, Inkscape::XML::Node *b, Visitor visitor)
Visit descendants of 2 nodes in parallel.
virtual Node * firstChild()=0
Get the first child of this node.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
virtual void removeChild(Node *child)=0
Remove a child of this node.
std::shared_ptr< Css const > css
static char const *const parent
Inkscape::XML::Node * node
Various utility functions.
Inkscape::IO::Writer Writer
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
void sp_repr_visit_descendants(Inkscape::XML::Node *node, Visitor visitor)
Visit all descendants recursively.
void sp_repr_css_attr_add_from_string(SPCSSAttr *css, const char *data)
Glib::ustring sp_repr_write_buf(Inkscape::XML::Node *repr, int indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, int inlineattrs, int indent, char const *old_href_base=nullptr, char const *new_href_base=nullptr)
SPCSSAttr * sp_repr_css_attr_new()
Creates an empty SPCSSAttr (a class for manipulating CSS style properties).
void sp_repr_css_set(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key)
void sp_repr_css_change(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key)
char const * sp_xml_ns_uri_prefix(char const *uri, char const *suggested)
void sp_repr_css_write_string(SPCSSAttr *css, Glib::ustring &str)
Write a style attribute string from a list of properties stored in an SPCSAttr object.
void sp_repr_css_merge(SPCSSAttr *dst, SPCSSAttr *src)
Merges two SPCSSAttr's.
SPCSSAttr * sp_repr_css_attr(Inkscape::XML::Node const *repr, char const *attr)
char const * sp_repr_css_property(SPCSSAttr *css, char const *name, char const *defval)
char const * sp_xml_ns_prefix_uri(char const *prefix)
bool sp_repr_is_meta_element(const Inkscape::XML::Node *node)
Determine if the node is a 'title', 'desc' or 'metadata' element.
std::vector< Inkscape::XML::Node * > sp_repr_lookup_property_many(Inkscape::XML::Node *repr, Glib::ustring const &property, Glib::ustring const &value, int maxdepth=-1)
bool sp_repr_save_rebased_file(Inkscape::XML::Document *doc, char const *filename_utf8, char const *default_ns, char const *old_base, char const *new_base_filename)
Inkscape::XML::Node * sp_repr_lookup_name(Inkscape::XML::Node *repr, char const *name, int maxdepth=-1)
Find an element node with the given name.
Inkscape::XML::Node * sp_repr_lookup_child(Inkscape::XML::Node *repr, char const *key, char const *value)
void sp_repr_css_attr_unref(SPCSSAttr *css)
Unreferences an SPCSSAttr (will be garbage collected if no references remain).
void sp_repr_write_stream(Inkscape::XML::Node *repr, Inkscape::IO::Writer &out, int indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, int inlineattrs, int indent, char const *old_href_base=nullptr, char const *new_href_base=nullptr)
int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second)
Works for different-parent objects, so long as they have a common ancestor.
SPCSSAttr * sp_repr_css_attr_inherited(Inkscape::XML::Node const *repr, char const *attr)
Glib::ustring sp_repr_save_buf(Inkscape::XML::Document *doc)
void sp_repr_css_set_property_string(SPCSSAttr *css, char const *name, std::string const &value)
Set a style property to a standard string.
void sp_repr_css_print(SPCSSAttr *css)
Loops through a List of style properties, printing key/value pairs.
Inkscape::XML::Document * sp_repr_document_new(char const *rootname)
Returns new document having as first child a node named rootname.
bool sp_repr_css_property_is_unset(SPCSSAttr *css, char const *name)
bool sp_repr_is_def(Inkscape::XML::Node const *node)
SPCSSAttr * sp_repr_css_attr_unset_all(SPCSSAttr *css)
Return a new SPCSSAttr with all the properties found in the input SPCSSAttr unset.
void sp_repr_save_stream(Inkscape::XML::Document *doc, FILE *to_file, char const *default_ns=nullptr, bool compress=false, char const *old_href_base=nullptr, char const *new_href_base=nullptr)
void sp_repr_unparent(Inkscape::XML::Node *repr)
Remove repr from children of its parent node.
Inkscape::XML::Node * sp_repr_document_first_child(Inkscape::XML::Document const *doc)
Inkscape::XML::Document * sp_repr_read_mem(char const *buffer, int length, char const *default_ns)
void sp_repr_css_unset_property(SPCSSAttr *css, char const *name)
bool sp_repr_compare_position_bool(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second)
Inkscape::XML::Document * sp_repr_read_file(char const *filename, char const *default_ns, bool xinclude=false)
bool sp_repr_is_layer(Inkscape::XML::Node const *node)
double sp_repr_css_double_property(SPCSSAttr *css, char const *name, double defval)
Inkscape::XML::Node * sp_repr_lookup_descendant(Inkscape::XML::Node *repr, char const *key, char const *value)
Inkscape::XML::Document * sp_repr_read_buf(const Glib::ustring &buf, const char *default_ns)
std::vector< Inkscape::XML::Node const * > sp_repr_lookup_name_many(Inkscape::XML::Node const *repr, char const *name, int maxdepth=-1)
bool sp_repr_save_file(Inkscape::XML::Document *doc, char const *filename, char const *default_ns=nullptr)
Glib::ustring sp_repr_lookup_content(Inkscape::XML::Node const *repr, gchar const *name, Glib::ustring otherwise={})
void sp_repr_css_change_recursive(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key)
void sp_repr_css_set_property(SPCSSAttr *css, char const *name, char const *value)
void sp_repr_css_set_property_double(SPCSSAttr *css, char const *name, double value)
static unsigned indent_level
Interface for XML documents.
Interface for XML documents.