Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::XML::Node Class Referenceabstract

Interface for refcounted XML nodes. More...

#include <node.h>

Inheritance diagram for Inkscape::XML::Node:
Inkscape::GC::Anchored Inkscape::XML::Document Inkscape::XML::SimpleNode SPCSSAttr Inkscape::XML::SimpleDocument Inkscape::XML::CommentNode Inkscape::XML::ElementNode Inkscape::XML::PINode Inkscape::XML::SimpleDocument Inkscape::XML::TextNode

Public Member Functions

 Node ()=default
 
 ~Node () override=default
 
Retrieve information about the node
virtual NodeType type () const =0
 Get the type of the node.
 
virtual char const * name () const =0
 Get the name of the element node.
 
virtual int code () const =0
 Get the integer code corresponding to the node's name.
 
virtual unsigned position () const =0
 Get the index of this node in parent's child order.
 
virtual unsigned childCount () const =0
 Get the number of children of this node.
 
virtual char const * content () const =0
 Get the content of a text or comment node.
 
virtual char const * attribute (char const *key) const =0
 Get the string representation of a node's attribute.
 
virtual const AttributeVectorattributeList () const =0
 Get a list of the node's attributes.
 
virtual bool matchAttributeName (char const *partial_name) const =0
 Check whether this node has any attribute that matches a string.
 
Modify the node
virtual void setPosition (int pos)=0
 Set the position of this node in parent's child order.
 
virtual void setContent (char const *value)=0
 Set the content of a text or comment node.
 
void setAttribute (Util::const_char_ptr key, Util::const_char_ptr value)
 Change an attribute of this node.
 
bool copyAttribute (Util::const_char_ptr key, Node const *source_node, bool remove_if_empty=false)
 Copy attribute value from another node to this node.
 
bool getAttributeBoolean (Util::const_char_ptr key, bool default_value=false) const
 Parses the boolean value of an attribute "key" in repr and sets val accordingly, or to false if the attr is not set.
 
int getAttributeInt (Util::const_char_ptr key, int default_value=0) const
 
double getAttributeDouble (Util::const_char_ptr key, double default_value=0.0) const
 
bool setAttributeBoolean (Util::const_char_ptr key, bool val)
 
bool setAttributeInt (Util::const_char_ptr key, int val)
 
bool setAttributeCssDouble (Util::const_char_ptr key, double val)
 Set a property attribute to val [slightly rounded], in the format required for CSS properties: in particular, it never uses exponent notation.
 
bool setAttributeSvgDouble (Util::const_char_ptr key, double val)
 For attributes where an exponent is allowed.
 
bool setAttributeSvgNonDefaultDouble (Util::const_char_ptr key, double val, double default_value)
 
bool setAttributeSvgLength (Util::const_char_ptr key, SVGLength const &val)
 
bool setAttributePoint (Util::const_char_ptr key, Geom::Point const &val)
 
Geom::Point getAttributePoint (Util::const_char_ptr key, Geom::Point default_value={}) const
 
void setAttributeOrRemoveIfEmpty (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
 Change an attribute of this node.
 
void removeAttribute (Inkscape::Util::const_char_ptr key)
 Remove an attribute of this node.
 
virtual void setCodeUnsafe (int code)=0
 Set the integer GQuark code for the name of the node.
 
Traverse the XML tree
virtual Documentdocument ()=0
 Get the node's associated document.
 
virtual Document const * document () const =0
 
virtual Noderoot ()=0
 Get the root node of this node's document.
 
virtual Node const * root () const =0
 
virtual Nodeparent ()=0
 Get the parent of this node.
 
virtual Node const * parent () const =0
 
virtual Nodenext ()=0
 Get the next sibling of this node.
 
virtual Node const * next () const =0
 
virtual Nodeprev ()=0
 
virtual Node const * prev () const =0
 
virtual NodefirstChild ()=0
 Get the first child of this node.
 
virtual Node const * firstChild () const =0
 
virtual NodelastChild ()=0
 Get the last child of this node.
 
virtual Node const * lastChild () const =0
 
virtual NodenthChild (unsigned index)=0
 Get the child of this node with a given index.
 
virtual Node const * nthChild (unsigned index) const =0
 
Manipulate the XML tree
virtual Nodeduplicate (Document *doc) const =0
 Create a duplicate of this node.
 
virtual void addChild (Node *child, Node *after)=0
 Insert another node as a child of this node.
 
void addChildAtPos (Node *child, unsigned pos)
 Insert another node as a child of this node.
 
virtual void appendChild (Node *child)=0
 Append a node as the last child of this node.
 
virtual void removeChild (Node *child)=0
 Remove a child of this node.
 
virtual void changeOrder (Node *child, Node *after)=0
 Move a given node in this node's child order.
 
virtual void cleanOriginal (Node *src, char const *key)=0
 Remove all elements that not in src node.
 
virtual bool equal (Node const *other, bool recursive, bool skip_ids=false)=0
 Compare 2 nodes equality.
 
virtual void mergeFrom (Node const *src, char const *key, bool extension=false, bool clean=false)=0
 Merge all children of another node with the current.
 
- Public Member Functions inherited from Inkscape::GC::Anchored
void anchor () const
 
void release () const
 
unsigned _anchored_refcount () const
 
 Anchored (Anchored const &)=delete
 
void operator= (Anchored const &)=delete
 

Related Symbols

(Note that these are not member symbols.)

Nodenext_node (Node *node)
 Get the next node in sibling order.
 
Nodeprevious_node (Node *node)
 Get the previous node in sibling order.
 
Nodeparent_node (Node *node)
 Get the node's parent.
 
Inkscape::XML::Nodesp_repr_lookup_child (Inkscape::XML::Node *repr, gchar const *key, gchar const *value)
 Find an element node using an unique attribute.
 
Inkscape::XML::Nodesp_repr_lookup_name (Inkscape::XML::Node *repr, char const *name, int maxdepth=-1)
 Find an element node with the given name.
 
template<typename Visitor >
void sp_repr_visit_descendants (Inkscape::XML::Node *node, Visitor visitor)
 Visit all descendants recursively.
 
template<typename Visitor >
void sp_repr_visit_descendants (Inkscape::XML::Node *a, Inkscape::XML::Node *b, Visitor visitor)
 Visit descendants of 2 nodes in parallel.
 

Notify observers about operations on the node

using iterator = Inkscape::XML::NodeSiblingIterator
 
virtual void addObserver (NodeObserver &observer)=0
 Add an object that will be notified of the changes to this node.
 
virtual void removeObserver (NodeObserver &observer)=0
 Remove an object from the list of observers.
 
virtual void synthesizeEvents (NodeObserver &observer)=0
 Generate a sequence of events corresponding to the state of this node.
 
virtual void addSubtreeObserver (NodeObserver &observer)=0
 Add an object that will be notified of the changes to this node and its descendants.
 
virtual void removeSubtreeObserver (NodeObserver &observer)=0
 Remove an object from the subtree observers list.
 
virtual void recursivePrintTree (unsigned level)=0
 
iterator begin ()
 Iterator over children.
 
iterator end ()
 Helper to use the standard lib container functions.
 
bool operator== (const std::string &name) const
 Compare a node by looking at its name to a string.
 
template<typename T >
NodefindChildPath (T list)
 depth first search to find a node
 
template<typename iterT >
NodefindChildPath (iterT itr, iterT end)
 template reshuffling to make the more useful findChildPath cleaner
 
 Node (Node const &)
 
virtual void setAttributeImpl (char const *key, char const *value)=0
 

Additional Inherited Members

- Protected Member Functions inherited from Inkscape::GC::Anchored
 Anchored ()
 
virtual ~Anchored ()=default
 

Detailed Description

Interface for refcounted XML nodes.

This class is an abstract base type for all nodes in an XML document - this includes everything except attributes. An XML document is also a node itself. This is the main class used for interfacing with Inkscape's documents. Everything that has to be stored in the SVG has to go through this class at some point.

Each node unconditionally has to belong to a document. There are no "documentless" nodes, and it's not possible to move nodes between documents - they have to be duplicated. Each node can only refer to the nodes in the same document. Name of the node is immutable, it cannot be changed after its creation. Same goes for the type of the node. To simplify the use of this class, you can perform all operations on all nodes, but only some of them make any sense. For example, only element nodes can have attributes, only element and document nodes can have children, and all nodes except element and document nodes can have content. Although you can set content for element nodes, it won't make any difference in the XML output.

To create new nodes, use the methods of the Inkscape::XML::Document class. You can obtain the nodes' document using the document() method. To destroy a node, just unparent it by calling sp_repr_unparent() or node->parent->removeChild() and release any references to it. The garbage collector will reclaim the memory in the next pass.

In addition to regular DOM manipulations, you can register observer objects that will receive notifications about changes made to the node. See the NodeObserver class.

See also
Inkscape::XML::Document
Inkscape::XML::NodeObserver

Definition at line 80 of file node.h.

Member Typedef Documentation

◆ iterator

Constructor & Destructor Documentation

◆ Node() [1/2]

Inkscape::XML::Node::Node ( )
default

◆ ~Node()

Inkscape::XML::Node::~Node ( )
overridedefault

◆ Node() [2/2]

Inkscape::XML::Node::Node ( Node const &  )
inlineprotected

Definition at line 601 of file node.h.

Member Function Documentation

◆ addChild()

virtual void Inkscape::XML::Node::addChild ( Node child,
Node after 
)
pure virtual

Insert another node as a child of this node.

When after is NULL, the inserted node will be placed as the first child of this node. after must be a child of this node.

Parameters
childThe node to insert
afterThe node after which the inserted node should be placed, or NULL

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Tools::TextTool::_setupText(), SPObject::addChild(), addChildAtPos(), Inkscape::UI::Dialog::DocumentProperties::addEmbeddedScript(), Inkscape::UI::Dialog::DocumentProperties::addExternalScript(), Inkscape::ObjectSet::cloneOriginalPathLPE(), Inkscape::UI::Dialog::XmlTree::cmd_duplicate_node(), Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), Inkscape::UI::Dialog::XmlTree::cmd_unindent_node(), Inkscape::create_layer(), create_text_with_rectangle(), Persp3D::create_xml_element(), Inkscape::LivePathEffect::Effect::createAndApply(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), SPDocument::createDoc(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), delete_line_break(), Inkscape::LivePathEffect::LPEBool::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), flowtext_to_text(), LivePathEffectObject::fork_private_if_necessary(), Inkscape::UI::Dialog::get_first_style_text_node(), Inkscape::ObjectSet::group(), move_child_nodes(), SPItem::moveTo(), SPTag::moveTo(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), recursively_apply_style(), redundant_semi_nesting_processor(), remove_marker_auto_start_reverse(), remove_marker_context_paint(), SPGradient::repr_write_vector(), Inkscape::UI::Tools::MeasureTool::setLabelText(), Inkscape::ObjectSet::setMask(), Inkscape::UI::Tools::MeasureTool::setMeasureItem(), SPObject::setTitleOrDesc(), sp_copy_resource(), sp_document_default_gradient_vector(), sp_gradient_add_stop(), sp_gradient_fork_vector_if_necessary(), sp_gradient_load_from_svg(), sp_import_document(), sp_item_group_ungroup(), sp_marker_fork_if_necessary(), sp_marker_load_from_svg(), sp_te_insert(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), sp_textpath_to_text(), sp_tref_convert_to_tspan(), sp_vector_add_stop(), split_text_object_tree_at(), Inkscape::SelTrans::stamp(), text_put_on_path(), text_unflow(), Inkscape::ObjectSet::toSymbol(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), Inkscape::ObjectSet::unsetMask(), SPSymbol::unSymbol(), verify_grad(), SPFilter::write(), SPFlowtext::write(), SPText::write(), SPTextPath::write(), SPTSpan::write(), SPDefs::write(), SPFlowdiv::write(), SPFlowtspan::write(), SPFlowpara::write(), SPFlowregion::write(), SPFlowregionExclude::write(), SPGradient::write(), SPGroup::write(), SPItem::write(), and SPObjectGroup::write().

◆ addChildAtPos()

void Inkscape::XML::Node::addChildAtPos ( Node child,
unsigned  pos 
)
inline

Insert another node as a child of this node.

This is more efficient than appendChild() + setPosition().

Parameters
childThe node to insert
posThe position in parent's child order

Definition at line 430 of file node.h.

References addChild(), child, and nthChild().

Referenced by Inkscape::Extension::Implementation::Script::PreviewObserver::createAndSendEvent(), SPDocument::getNamedView(), item_to_paths(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::ObjectSet::setClipGroup(), and Inkscape::ObjectSet::toSymbol().

◆ addObserver()

◆ addSubtreeObserver()

virtual void Inkscape::XML::Node::addSubtreeObserver ( NodeObserver observer)
pure virtual

Add an object that will be notified of the changes to this node and its descendants.

The difference between adding a regular observer and a subtree observer is that the subtree observer will also be notified if a change occurs to any of the node's descendants, while a regular observer will only be notified of changes to the node it was assigned to.

Parameters
observerThe observer object

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Preferences::addObserver(), Inkscape::UI::Dialog::StyleDialog::documentReplaced(), and Inkscape::XML::Subtree::Subtree().

◆ appendChild()

virtual void Inkscape::XML::Node::appendChild ( Node child)
pure virtual

Append a node as the last child of this node.

Parameters
childThe node to append

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Extension::Internal::SvgBuilder::_addStopToGradient(), Inkscape::Extension::Internal::SvgBuilder::_addToContainer(), SPGrid::_checkOldGrid(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::SvgBuilder::_createMask(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::Extension::Internal::SvgBuilder::_flushTextText(), Inkscape::Extension::Internal::SvgBuilder::_getColorProfile(), Inkscape::Preferences::_getNode(), SPDocument::_importDefsNode(), Inkscape::Extension::Internal::SvgBuilder::_pushGroup(), Inkscape::LivePathEffect::LPEPowerClip::add(), Inkscape::UI::Dialog::CPHistoryXML::add_action_parameter(), Inkscape::UI::Dialog::CPHistoryXML::add_operation(), Inkscape::UI::Widget::GradientSelector::add_vector_clicked(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), Inkscape::Extension::Internal::SvgBuilder::addSoftMaskedImage(), SPObject::appendChild(), SPObject::appendChildRepr(), Inkscape::UI::Dialog::XmlTree::cmd_new_element_node(), Inkscape::UI::Dialog::XmlTree::cmd_new_text_node(), SPBox3D::convert_to_group(), SPDocument::copy(), Inkscape::UI::Dialog::CPHistoryXML::CPHistoryXML(), Inkscape::Extension::Internal::Filter::create_and_apply_filter(), create_flowtext_with_internal_frame(), Inkscape::create_layer(), SPFont::create_new_glyph(), create_text_with_inline_size(), create_text_with_rectangle(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), Inkscape::ObjectSet::duplicate(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::duplicate_filter(), Inkscape::UI::Dialog::FilterEffectsDialog::duplicate_primitive(), Inkscape::Extension::Internal::BlurEdge::effect(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::Extension::Internal::Grid::effect(), file_import(), generate_marker(), Inkscape::UI::Dialog::get_first_style_text_node(), SPFlowtext::getAsText(), Inkscape::ObjectSet::group(), ink_copy_generic_children(), insert_hatch_polyfill(), insert_mesh_polyfill(), insert_text_fallback(), item_to_paths(), item_to_paths_add_marker(), Inkscape::Extension::Internal::Filter::merge_filters(), modify_filter_gaussian_blur_from_item(), move_child_nodes(), Inkscape::UI::Tools::MeshTool::new_default(), new_filter_blend_gaussian_blur(), new_filter_gaussian_blur(), Inkscape::UI::Dialog::new_font(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_click_released(), Inkscape::Extension::Internal::GdkpixbufInput::open(), Inkscape::Extension::Internal::Svg::open(), Inkscape::Colors::paint_to_xml(), Inkscape::Extension::Internal::SvgBuilder::pushPage(), SPDocument::rebase(), recursively_apply_style(), Inkscape::Extension::Implementation::Script::PreviewObserver::selectionChanged(), Inkscape::ObjectSet::setClipGroup(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), Inkscape::ObjectSet::setMask(), show_output(), SPFont::sort_glyphs(), sp_gradient_fork_private_if_necessary(), sp_gradient_get_private_normalized(), sp_repr_do_read(), sp_repr_document_new(), sp_repr_svg_read_node(), Inkscape::UI::Tools::sp_spray_recursive(), sp_te_insert(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), split_text_object_tree_at(), Inkscape::UI::Dialog::XmlTree::stopNodeEditing(), XmlReprActionTest::testRollbackOfNodeAddition(), XmlReprActionTest::testRollbackOfNodeRemoval(), XmlReprActionTest::testRollbackOfNodeReordering(), text_flow_into_shape(), text_put_on_path(), text_to_glyphs(), text_unflow(), Inkscape::ObjectSet::toSymbol(), SPSymbol::unSymbol(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), and SPMeshNodeArray::write().

◆ attribute()

virtual char const * Inkscape::XML::Node::attribute ( char const *  key) const
pure virtual

Get the string representation of a node's attribute.

If there is no attribute with the given name, the method will return NULL. All strings returned by this method are owned by the node and may not be freed. The returned pointer will become invalid when the attribute changes. If you need to store the return value, use g_strdup(). To parse the string, use methods in repr.h

Parameters
keyThe name of the node's attribute

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Extension::Internal::SvgBuilder::_attrEqual(), Inkscape::UI::Tools::EraserTool::_booleanErase(), SPPattern::_chain(), SPGrid::_checkOldGrid(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::UI::PathManipulator::_createControlPointsFromGeometry(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::Extension::Internal::SvgBuilder::_getClip(), Inkscape::Preferences::_getRawValue(), SPDocument::_importDefsNode(), Inkscape::UI::Dialog::SelectorsDialog::_insertClass(), Inkscape::Selection::_objectForXMLNode(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::Shortcuts::_read(), Inkscape::UI::Dialog::SelectorsDialog::_removeClass(), Inkscape::UI::Toolbar::Box3DToolbar::_selectionChanged(), Inkscape::Extension::Internal::SvgBuilder::_shouldClip(), Inkscape::UI::Dialog::StyleDialog::_writeStyleElement(), Inkscape::ObjectSet::add(), Inkscape::UI::Widget::MarkerComboBox::add_markers(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), SPLPEItem::addPathEffect(), Inkscape::Extension::Internal::SvgBuilder::addSoftMaskedImage(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), SPAttributeTable::attribute_table_object_modified(), Inkscape::UI::Widget::AttrWidget::attribute_value(), Inkscape::Extension::Internal::PrintEmf::begin(), Inkscape::Extension::Internal::PrintWmf::begin(), Inkscape::ObjectSet::breakApart(), SPObject::build(), SPGradient::build(), SPOffset::build(), Inkscape::XML::SimpleNode::cleanOriginal(), SPPattern::clone_if_necessary(), SPHatch::clone_if_necessary(), Inkscape::ObjectSet::cloneOriginalPathLPE(), Inkscape::ObjectSet::combine(), copyAttribute(), SPClipPath::create(), SPMask::create(), Inkscape::Extension::Internal::Filter::create_and_apply_filter(), create_text_with_rectangle(), Inkscape::LivePathEffect::Effect::createAndApply(), Inkscape::LivePathEffect::LPECopyRotate::createPathBase(), Inkscape::LivePathEffect::LPEMirrorSymmetry::createPathBase(), Inkscape::LivePathEffect::LPESlice::createPathBase(), Inkscape::LivePathEffect::LPETiling::createPathBase(), css_attrs_are_equal(), delete_line_break(), Inkscape::Extension::Dependency::Dependency(), SPImage::description(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::Effect::doOnBeforeCommit(), Inkscape::UI::Dialog::Print::draw_page(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Extension::Extension(), Inkscape::Extension::Internal::Filter::Filter::filters_load_node(), Inkscape::UI::Widget::MarkerComboBox::find_marker_item(), find_references(), Inkscape::fixBrokenLinks(), Inkscape::LivePathEffect::LPEBool::fractureit(), generate_marker(), Inkscape::UI::Widget::MarkerComboBox::get_active_marker_uri(), InkFileExportCmd::get_bgcolor(), Inkscape::Extension::Effect::get_menu(), SPFilter::get_new_result_name(), NodeTraits::get_type_string(), SPObject::getAttribute(), Inkscape::Extension::Internal::getAttribute(), getAttributeBoolean(), getAttributeDouble(), getAttributeInt(), getAttributePoint(), SPObject::getExportFilename(), Inkscape::getHrefAttribute(), ink_copy_generic_attributes(), insert_text_fallback(), SPObject::invoke_build(), Inkscape::Extension::InxParameter::InxParameter(), Inkscape::Extension::InxWidget::InxWidget(), Inkscape::UI::Dialog::CloneTiler::is_a_clone_of(), Inkscape::UI::Dialog::Find::item_attr_match(), Inkscape::UI::Dialog::Find::item_attrvalue_match(), Inkscape::UI::Dialog::Find::item_font_match(), Inkscape::UI::Dialog::Find::item_id_match(), Inkscape::UI::Dialog::Find::item_style_match(), item_to_paths(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Loader::load_implementation(), Inkscape::LivePathEffect::LPETaperStroke::LPETaperStroke(), Inkscape::Extension::InxParameter::make(), Inkscape::Extension::Internal::Filter::merge_filters(), Inkscape::UI::Dialog::SvgFontsDialog::missing_glyph_description_from_selected_path(), normalize_all_paths(), Inkscape::UI::Toolbar::StarToolbar::notifyAttributeChanged(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_click_released(), overwrite_style_with_string(), Inkscape::Extension::ParamFloat::ParamFloat(), Inkscape::Extension::ParamInt::ParamInt(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(), Inkscape::Extension::ParamPath::ParamPath(), Inkscape::Extension::ParamString::ParamString(), path_simplify(), print_current_persp3d(), Inkscape::LivePathEffect::LPEMeasureSegments::processObjects(), Inkscape::Extension::PathEffect::processPathEffects(), SPPattern::produce(), SPStyle::read(), Inkscape::LivePathEffect::Parameter::read_from_SVG(), Inkscape::LivePathEffect::Effect::readallParameters(), SPObject::readAttr(), SPIBase::readAttribute(), Inkscape::UI::Dialog::StyleDialog::readStyleElement(), rebase_image_href(), refresh_offset_source(), remove_marker_auto_start_reverse(), remove_marker_context_paint(), remove_marker_context_paint(), SPAttributeTable::reread_properties(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Inkscape::Extension::save(), SPGuide::set(), Inkscape::ObjectSet::set(), Inkscape::UI::Dialog::SvgFontsDialog::set_glyph_description_from_selected_path(), SPOffset::set_shape(), Inkscape::setHrefAttribute(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), Inkscape::Extension::Internal::SvgBuilder::shouldMergePath(), sp_attribute_clean_element(), sp_attribute_clean_style(), sp_get_pattern_label(), sp_gradient_fork_private_if_necessary(), sp_import_document(), sp_item_list_to_curves(), sp_item_transform_repr(), sp_lpe_item_cleanup_original_path_recursive(), sp_marker_fork_if_necessary(), Inkscape::UI::Widget::sp_mesh_menu_build(), sp_repr_css_add_components(), sp_repr_is_layer(), sp_repr_lookup_descendant(), sp_repr_write_stream_element(), sp_selected_item_to_curved_repr(), sp_selected_path_create_offset_object(), Inkscape::UI::Tools::sp_spray_recursive(), sp_tref_convert_to_tspan(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE(), Inkscape::UI::Tools::spdc_create_single_dot(), Inkscape::SelTrans::stamp(), GrDrag::styleSet(), Inkscape::Extension::Internal::svgSetTransform(), Inkscape::ObjectSet::swapFillStroke(), text_categorize_refs(), text_flow_into_shape(), text_put_on_path(), text_relink_refs(), text_remove_all_kerns_recursively(), tidy_operator_repeated_spans(), Inkscape::UI::Dialog::LivePathEffectEditor::toggleVisible(), Inkscape::ObjectSet::toSymbol(), SPUse::unlink(), Inkscape::UI::Widget::SelectedStyle::update(), Inkscape::UI::Toolbar::GradientToolbar::update_stop_list(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), Inkscape::UI::Widget::PaintSelector::updateMeshList(), Inkscape::Extension::WidgetImage::WidgetImage(), Inkscape::Extension::WidgetLabel::WidgetLabel(), Inkscape::Extension::WidgetSpacer::WidgetSpacer(), SPObject::write(), SPRoot::write(), and Inkscape::UI::Widget::RegisteredWidget< W >::write_to_xml().

◆ attributeList()

◆ begin()

◆ changeOrder()

virtual void Inkscape::XML::Node::changeOrder ( Node child,
Node after 
)
pure virtual

◆ childCount()

virtual unsigned Inkscape::XML::Node::childCount ( ) const
pure virtual

◆ cleanOriginal()

virtual void Inkscape::XML::Node::cleanOriginal ( Node src,
char const *  key 
)
pure virtual

Remove all elements that not in src node.

Parameters
srcThe node to check for elements into this node
keyThe attribute to use as the identity attribute

◆ code()

virtual int Inkscape::XML::Node::code ( ) const
pure virtual

Get the integer code corresponding to the node's name.

Returns
GQuark code corresponding to the name

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Dialog::get_first_style_text_node(), Inkscape::XML::id_permitted(), Inkscape::XML::rebase_hrefs(), sp_repr_lookup_name(), sp_repr_lookup_name_many(), and sp_repr_write_stream_element().

◆ content()

virtual char const * Inkscape::XML::Node::content ( ) const
pure virtual

Get the content of a text or comment node.

This method makes no sense for element nodes. To retrieve the element node's name, use the name() method.

Returns
The node's content

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Dialog::StyleDialog::_writeStyleElement(), Inkscape::Extension::Implementation::Script::check(), concat_children(), Inkscape::Extension::Dependency::Dependency(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), duplicate_node_without_children(), Inkscape::Extension::Effect::Effect(), Inkscape::XML::SimpleNode::equal(), Inkscape::Extension::Extension::Extension(), Inkscape::Extension::Internal::gatherText(), Inkscape::Extension::Input::Input(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Implementation::XSLT::load(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::Extension::Output::Output(), Inkscape::Extension::ParamBool::ParamBool(), Inkscape::Extension::ParamColor::ParamColor(), Inkscape::Extension::ParamFloat::ParamFloat(), Inkscape::Extension::ParamInt::ParamInt(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(), Inkscape::Extension::ParamPath::ParamPath(), Inkscape::Extension::ParamString::ParamString(), Inkscape::Extension::ProcessingAction::ProcessingAction(), SPString::read_content(), Inkscape::UI::Dialog::StyleDialog::readStyleElement(), sp_repr_lookup_content(), sp_repr_svg_read_node(), sp_repr_write_stream(), Inkscape::Extension::WidgetImage::WidgetImage(), and Inkscape::Extension::WidgetLabel::WidgetLabel().

◆ copyAttribute()

bool Inkscape::XML::Node::copyAttribute ( Util::const_char_ptr  key,
Node const *  source_node,
bool  remove_if_empty = false 
)

Copy attribute value from another node to this node.

Parameters
keyName of the attribute to change
source_nodeNode from which to take the attribute value
remove_if_emptyIf true, and the source node has no such attribute, or the source node's value for the attribute is an empty string, the attribute will be removed (if present) from this node.
Returns
true if the attribute was set, false otherwise.

Definition at line 30 of file node.cpp.

References attribute(), key, removeAttribute(), and setAttribute().

◆ document() [1/2]

virtual Document const * Inkscape::XML::Node::document ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ document() [2/2]

◆ duplicate()

virtual Node * Inkscape::XML::Node::duplicate ( Document doc) const
pure virtual

Create a duplicate of this node.

The newly created node has no parent, and a refcount equal 1. You need to manually insert it into the document, using e.g. appendChild(). Afterwards, call Inkscape::GC::release on it, so that it will be automatically collected when the parent is collected.

Parameters
docThe document in which the duplicate should be created
Returns
A pointer to the duplicated node

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Tools::EraserTool::_booleanErase(), Inkscape::UI::Tools::EraserTool::_clipErase(), SPDocument::_importDefsNode(), Inkscape::LivePathEffect::LPEPowerClip::add(), Inkscape::UI::Widget::GradientSelector::add_vector_clicked(), Inkscape::UI::Dialog::XmlTree::cmd_duplicate_node(), SPDocument::copy(), Inkscape::ObjectSet::duplicate(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::duplicate_filter(), Inkscape::UI::Dialog::FilterEffectsDialog::duplicate_primitive(), file_import(), LivePathEffectObject::fork_private_if_necessary(), Inkscape::ObjectSet::group(), item_to_paths_add_marker(), Inkscape::XML::SimpleNode::mergeFrom(), modify_filter_gaussian_blur_from_item(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), SPDocument::rebase(), remove_marker_context_paint(), Inkscape::ObjectSet::setClipGroup(), Inkscape::ObjectSet::setMask(), Inkscape::BooleanBuilder::shape_commit(), sp_copy_resource(), sp_gradient_add_stop(), sp_gradient_fork_vector_if_necessary(), sp_gradient_load_from_svg(), sp_import_document(), sp_item_group_ungroup(), sp_marker_fork_if_necessary(), sp_marker_load_from_svg(), sp_selection_copy_one(), Inkscape::UI::Tools::sp_spray_recursive(), sp_tref_convert_to_tspan(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), sp_vector_add_stop(), Inkscape::SelTrans::stamp(), text_flow_into_shape(), Inkscape::ObjectSet::tile(), Inkscape::ObjectSet::toMarker(), Inkscape::LivePathEffect::LPEPowerMask::tryForkMask(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), Inkscape::ObjectSet::unsetMask(), Inkscape::ObjectSet::untile(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), verify_grad(), SPFeDiffuseLighting::write(), SPFeDistantLight::write(), SPFePointLight::write(), SPFilterPrimitive::write(), SPFeSpecularLighting::write(), SPFeSpotLight::write(), SPFeTurbulence::write(), SPObject::write(), SPDesc::write(), SPMetadata::write(), SPNamedView::write(), and SPTitle::write().

◆ end()

iterator Inkscape::XML::Node::end ( )
inline

Helper to use the standard lib container functions.

Definition at line 559 of file node.h.

Referenced by Avoid::HyperedgeImprover::createShiftSegmentsForDimensionExcluding(), and findChildPath().

◆ equal()

virtual bool Inkscape::XML::Node::equal ( Node const *  other,
bool  recursive,
bool  skip_ids = false 
)
pure virtual

Compare 2 nodes equality.

Parameters
otherThe other node to compare
recursiveRecursive mode check

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::XML::SimpleNode::mergeFrom().

◆ findChildPath() [1/2]

template<typename iterT >
Node * Inkscape::XML::Node::findChildPath ( iterT  itr,
iterT  end 
)
inline

template reshuffling to make the more useful findChildPath cleaner

Definition at line 582 of file node.h.

References child, end(), and findChildPath().

◆ findChildPath() [2/2]

template<typename T >
Node * Inkscape::XML::Node::findChildPath ( list)
inline

depth first search to find a node

This function takes any list structure you want and uses that to compare Node's down the child tree. It will do depth first searching into the tree. The key part is that since it is a template you have flexibility on the container, and the comparison that is being used. Typically it will be used with something like a std::list<std::string> which will compare against the node's name but more complex searches could be imagined.

Definition at line 575 of file node.h.

References findChildPath().

Referenced by findChildPath(), and findChildPath().

◆ firstChild() [1/2]

virtual Node const * Inkscape::XML::Node::firstChild ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ firstChild() [2/2]

virtual Node * Inkscape::XML::Node::firstChild ( )
pure virtual

Get the first child of this node.

For nodes without any children, this method returns NULL.

Returns
Pointer to the first child, or NULL

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Preferences::_findObserverNode(), Inkscape::Preferences::_getNode(), SPDocument::_importDefsNode(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::Shortcuts::_read(), Inkscape::Shortcuts::_read(), Inkscape::UI::Dialog::CPHistoryXML::add_action_parameter(), Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), begin(), SPObject::build(), SPMetadata::build(), SPStyleElem::build(), Inkscape::Extension::build_from_reprdoc(), build_string_from_root(), Inkscape::Extension::Implementation::Script::check(), Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), Inkscape::UI::Dialog::XmlTree::cmd_raise_node(), concat_children(), SPDocument::copy(), Inkscape::UI::Dialog::CPHistoryXML::CPHistoryXML(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), GrDrag::deleteSelected(), Inkscape::Extension::Dependency::Dependency(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Effect::Effect(), Inkscape::XML::SimpleNode::equal(), Inkscape::Extension::Extension::Extension(), file_import_pages(), Inkscape::Extension::Internal::Filter::filters_load_file(), Inkscape::Extension::Effect::find_menu(), Inkscape::Extension::Internal::gatherText(), Inkscape::UI::Dialog::CPHistoryXML::get_action_parameter_history(), Inkscape::Shortcuts::get_file_names(), Inkscape::UI::Dialog::get_first_style_text_node(), Inkscape::Extension::Effect::get_menu(), Inkscape::UI::Dialog::CPHistoryXML::get_operation_history(), Inkscape::Preferences::getAllDirs(), ink_copy_generic_children(), Inkscape::Extension::Input::Input(), insert_hatch_polyfill(), insert_mesh_polyfill(), insert_text_fallback(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Implementation::XSLT::load(), Inkscape::Extension::Loader::load_implementation(), Inkscape::Extension::Internal::Filter::merge_filters(), Inkscape::XML::SimpleNode::mergeFrom(), modify_filter_gaussian_blur_from_item(), move_child_nodes(), normalize_all_paths(), Inkscape::UI::Dialog::XmlTree::on_tree_select_row_enable(), Inkscape::Extension::Output::Output(), Inkscape::Extension::ParamBool::ParamBool(), Inkscape::Extension::ParamColor::ParamColor(), Inkscape::Extension::ParamFloat::ParamFloat(), Inkscape::Extension::ParamInt::ParamInt(), Inkscape::Extension::ParamNotebook::ParamNotebook(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::ParamNotebookPage(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(), Inkscape::Extension::ParamPath::ParamPath(), Inkscape::Extension::ParamString::ParamString(), Inkscape::Extension::Internal::OdfOutput::preprocess(), Inkscape::Extension::ProcessingAction::ProcessingAction(), prune_inkscape_from_node(), prune_proprietary_from_node(), rdf_match_license(), SPDocument::rebase(), redundant_double_nesting_processor(), Inkscape::Preferences::remove(), remove_filter_gaussian_blur(), remove_marker_auto_start_reverse(), remove_marker_context_paint(), remove_marker_context_paint(), SPGradient::repr_clear_vector(), Inkscape::XML::SimpleNode::root(), sp_attribute_clean_recursive(), sp_attribute_sort_recursive(), sp_gradient_fork_private_if_necessary(), sp_import_document(), sp_repr_css_change_recursive(), sp_repr_document_first_child(), sp_repr_lookup_child(), sp_repr_lookup_content(), sp_repr_lookup_descendant(), sp_repr_lookup_name(), sp_repr_lookup_name_many(), sp_repr_lookup_property_many(), sp_repr_visit_descendants(), sp_repr_visit_descendants(), sp_repr_write_stream_element(), tidy_operator_inexplicable_spans(), Inkscape::Extension::WidgetBox::WidgetBox(), Inkscape::Extension::WidgetImage::WidgetImage(), Inkscape::Extension::WidgetLabel::WidgetLabel(), Inkscape::Extension::Internal::OdfOutput::writeTree(), and Inkscape::Colors::xml_to_paint().

◆ getAttributeBoolean()

bool Inkscape::XML::Node::getAttributeBoolean ( Util::const_char_ptr  key,
bool  default_value = false 
) const

Parses the boolean value of an attribute "key" in repr and sets val accordingly, or to false if the attr is not set.

Returns
true if the attr was set, false otherwise.

Definition at line 49 of file node.cpp.

References attribute(), and Inkscape::Util::const_char_ptr::data().

Referenced by Inkscape::Extension::Internal::SvgBuilder::_createImage(), SPNamedView::getLockGuides(), and SPNamedView::getShowGuides().

◆ getAttributeDouble()

◆ getAttributeInt()

int Inkscape::XML::Node::getAttributeInt ( Util::const_char_ptr  key,
int  default_value = 0 
) const

◆ getAttributePoint()

Geom::Point Inkscape::XML::Node::getAttributePoint ( Util::const_char_ptr  key,
Geom::Point  default_value = {} 
) const

Definition at line 146 of file node.cpp.

References attribute(), and Inkscape::Util::const_char_ptr::data().

Referenced by sp_import_document().

◆ lastChild() [1/2]

virtual Node const * Inkscape::XML::Node::lastChild ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ lastChild() [2/2]

◆ matchAttributeName()

virtual bool Inkscape::XML::Node::matchAttributeName ( char const *  partial_name) const
pure virtual

Check whether this node has any attribute that matches a string.

This method checks whether this node has any attributes whose names have partial_name as their substrings. The check is done using the strstr() function of the C library. I don't know what would require that functionality, because matchAttributeName("id") matches both "identity" and "hidden".

Parameters
partial_nameThe string to match against all attributes
Returns
true if there is such an attribute, false otherwise

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Dialog::Find::item_attr_match(), Inkscape::UI::Dialog::SvgFontsDialog::missing_glyph_description_from_selected_path(), and Inkscape::UI::Dialog::SvgFontsDialog::set_glyph_description_from_selected_path().

◆ mergeFrom()

virtual void Inkscape::XML::Node::mergeFrom ( Node const *  src,
char const *  key,
bool  extension = false,
bool  clean = false 
)
pure virtual

Merge all children of another node with the current.

This method merges two node hierarchies, where src takes precedence. key is the name of the attribute that determines whether two nodes are corresponding (it must be the same for both, and all of their ancestors). If there is a corresponding node in src hierarchy, their attributes and content override the ones already present in this node's hierarchy. If there is no corresponding node, it is copied from src to this node. This method is used when merging the user's preferences file with the defaults, and has little use beyond that.

Parameters
srcThe node to merge into this node
keyThe attribute to use as the identity attribute
noidIf true process noid items
keyIf clean callback to cleanOriginal

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Preferences::_load(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::migrateDetails(), SPDocument::rebase(), sp_repr_css_merge(), SPMetadata::write(), SPLine::write(), SPNamedView::write(), and SPPolyLine::write().

◆ name()

virtual char const * Inkscape::XML::Node::name ( ) const
pure virtual

Get the name of the element node.

This method only makes sense for element nodes. Names are stored as GQuarks to accelerate conversions.

Returns
Name for element nodes, NULL for others

Implemented in Inkscape::XML::SimpleNode.

Referenced by SPClipPathReference::_acceptObject(), SPMaskReference::_acceptObject(), Inkscape::UI::Dialog::CPHistoryXML::_get_operation_type(), Inkscape::Extension::Internal::SvgBuilder::addShadedFill(), Inkscape::UI::Dialog::Find::all_items(), Inkscape::UI::Dialog::SpellCheck::allTextItems(), Inkscape::Extension::build_from_reprdoc(), Inkscape::Extension::Implementation::Script::check(), SPDocument::createNewDoc(), SPDocument::createNewDocFromMem(), duplicate_node_without_children(), Inkscape::XML::SimpleNode::equal(), Inkscape::Extension::Extension::Extension(), file_import(), find_references(), SPObject::generate_unique_id(), NodeTraits::get_type_string(), SPObject::getTagName(), gr_prepare_label(), Inkscape::Extension::Input::Input(), insert_text_fallback(), Inkscape::Extension::InxWidget::InxWidget(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Implementation::XSLT::load(), Inkscape::Extension::Loader::load_implementation(), Inkscape::loadImpl(), Inkscape::Extension::InxWidget::make(), Inkscape::Extension::Internal::Filter::merge_filters(), modify_filter_gaussian_blur_from_item(), Inkscape::Extension::Implementation::XSLT::open(), operator==(), Inkscape::Extension::Output::Output(), Inkscape::Extension::ParamNotebook::ParamNotebook(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::ParamNotebookPage(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(), Inkscape::Extension::Internal::OdfOutput::preprocess(), remove_filter_gaussian_blur(), remove_marker_context_paint(), Inkscape::UI::Dialog::AttrDialog::setRepr(), sp_attribute_clean_element(), sp_attribute_clean_recursive(), sp_attribute_clean_style(), sp_attribute_sort_recursive(), sp_item_group_ungroup(), sp_repr_is_def(), sp_repr_is_meta_element(), sp_repr_svg_read_node(), sp_repr_write_stream(), sp_repr_write_stream_element(), text_categorize_refs(), text_relink_refs(), tidy_operator_repeated_spans(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::update(), Inkscape::UI::Dialog::FilterEffectsDialog::update_settings_view(), Inkscape::Extension::WidgetBox::WidgetBox(), Inkscape::Extension::WidgetLabel::WidgetLabel(), Inkscape::Extension::Internal::OdfOutput::writeTree(), and Inkscape::UI::Dialog::XmlTree::xml_tree_node_mutable().

◆ next() [1/2]

virtual Node const * Inkscape::XML::Node::next ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ next() [2/2]

virtual Node * Inkscape::XML::Node::next ( )
pure virtual

Get the next sibling of this node.

This method will return NULL if the node is the last sibling element of the parent. The nodes form a singly-linked list, so there is no "prev()" method. Use the provided external function for that.

Returns
Pointer to the next sibling, or NULL
See also
Inkscape::XML::previous_node()

Implemented in Inkscape::XML::SimpleNode.

Referenced by SPDocument::_importDefsNode(), Inkscape::Extension::build_from_reprdoc(), build_string_from_root(), Inkscape::Extension::Implementation::Script::check(), Inkscape::XML::SimpleNode::cleanOriginal(), Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), Inkscape::UI::Dialog::XmlTree::cmd_lower_node(), Inkscape::UI::Dialog::XmlTree::cmd_raise_node(), GrDrag::deleteSelected(), Inkscape::XML::SimpleNode::equal(), Inkscape::Extension::Extension::Extension(), Inkscape::Extension::Internal::Filter::filters_load_file(), Inkscape::Extension::Effect::find_menu(), Inkscape::Extension::Internal::gatherText(), Inkscape::UI::Dialog::get_first_style_text_node(), Inkscape::Extension::Input::Input(), insert_text_fallback(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Implementation::XSLT::load(), Inkscape::Extension::Loader::load_implementation(), modify_filter_gaussian_blur_from_item(), Inkscape::XML::NodeSiblingIteratorStrategy::next(), next_node(), Inkscape::XML::next_node(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), Inkscape::UI::Dialog::XmlTree::on_tree_select_row_enable(), Inkscape::Extension::Output::Output(), Inkscape::Extension::ParamNotebook::ParamNotebook(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::ParamNotebookPage(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), prune_inkscape_from_node(), rdf_match_license(), SPDocument::rebase(), remove_filter_gaussian_blur(), remove_marker_auto_start_reverse(), sp_import_document(), sp_repr_do_read(), sp_repr_lookup_descendant(), sp_repr_lookup_name(), sp_repr_save_writer(), sp_repr_write_stream_element(), XmlReprActionTest::testRollbackOfNodeReordering(), Inkscape::Extension::WidgetBox::WidgetBox(), Inkscape::Extension::WidgetLabel::WidgetLabel(), and Inkscape::Extension::Internal::OdfOutput::writeTree().

◆ nthChild() [1/2]

virtual Node const * Inkscape::XML::Node::nthChild ( unsigned  index) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ nthChild() [2/2]

virtual Node * Inkscape::XML::Node::nthChild ( unsigned  index)
pure virtual

Get the child of this node with a given index.

If there is no child with the specified index number, this method will return NULL.

Parameters
indexThe zero-based index of the child to retrieve
Returns
Pointer to the appropriate child, or NULL

Implemented in Inkscape::XML::SimpleNode.

Referenced by addChildAtPos(), and Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply().

◆ operator==()

bool Inkscape::XML::Node::operator== ( const std::string &  name) const
inline

Compare a node by looking at its name to a string.

Definition at line 562 of file node.h.

References name().

◆ parent() [1/2]

virtual Node const * Inkscape::XML::Node::parent ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ parent() [2/2]

virtual Node * Inkscape::XML::Node::parent ( )
pure virtual

Get the parent of this node.

This method will return NULL for detached nodes.

Returns
Pointer to the parent, or NULL

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Extension::Internal::SvgBuilder::_addToContainer(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::LayerManager::_rebuild(), Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), Inkscape::ObjectSet::breakApart(), Inkscape::ObjectSet::clone(), Inkscape::UI::Dialog::XmlTree::cmd_delete_node(), Inkscape::UI::Dialog::XmlTree::cmd_duplicate_node(), Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), Inkscape::UI::Dialog::XmlTree::cmd_lower_node(), Inkscape::UI::Dialog::XmlTree::cmd_raise_node(), Inkscape::UI::Dialog::XmlTree::cmd_unindent_node(), Inkscape::ObjectSet::combine(), Inkscape::create_layer(), delete_line_break(), SPObject::deleteObject(), GrDrag::deleteSelected(), Inkscape::ObjectSet::duplicate(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::duplicate_filter(), Inkscape::Extension::Internal::BlurEdge::effect(), find_containing_child(), flowtext_to_text(), Inkscape::UI::Dialog::ObjectsPanel::getWatcher(), Inkscape::ObjectSet::group(), is_descendant_of(), item_to_paths(), SPItem::lowerOne(), SPItem::moveTo(), SPTag::moveTo(), Inkscape::XML::NodeParentIteratorStrategy::next(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), Inkscape::UI::Dialog::XmlTree::on_tree_select_row_enable(), parent_node(), Inkscape::XML::parent_node(), SPItem::raiseOne(), SPItem::raiseToTop(), SPStyle::read(), Inkscape::Preferences::remove(), Inkscape::XML::SimpleNode::root(), SvgFont::scaled_font_render_glyph(), Inkscape::UI::Dialog::XmlTree::set_dt_select(), Inkscape::ObjectSet::setMask(), SPPage::setPageIndex(), Inkscape::UI::Dialog::AttrDialog::setRepr(), sp_attribute_clean_style(), sp_import_document(), sp_item_list_to_curves(), sp_lpe_item_cleanup_original_path_recursive(), sp_repr_compare_position(), sp_repr_css_attr_inherited_recursive(), sp_repr_is_def(), sp_repr_svg_read_node(), sp_repr_unparent(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), Inkscape::UI::Tools::sp_spray_recursive(), sp_tref_convert_to_tspan(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), Inkscape::UI::Tools::spdc_flush_white(), Inkscape::SelTrans::stamp(), Inkscape::UI::Dialog::XmlTree::stopNodeEditing(), XmlReprActionTest::testRollbackOfNodeAddition(), XmlReprActionTest::testRollbackOfNodeRemoval(), text_put_on_path(), tidy_operator_repeated_spans(), Inkscape::ObjectSet::toLayer(), Inkscape::ObjectSet::toSymbol(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), SPUse::unlink(), Inkscape::ObjectSet::unsetMask(), SPSymbol::unSymbol(), Inkscape::UI::Dialog::XmlTree::xml_tree_node_mutable(), and Inkscape::Extension::Effect::~Effect().

◆ position()

◆ prev() [1/2]

virtual Node const * Inkscape::XML::Node::prev ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ prev() [2/2]

◆ recursivePrintTree()

virtual void Inkscape::XML::Node::recursivePrintTree ( unsigned  level)
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ removeAttribute()

void Inkscape::XML::Node::removeAttribute ( Inkscape::Util::const_char_ptr  key)
inline

Remove an attribute of this node.

Parameters
keyName of the attribute to delete

Definition at line 280 of file node.h.

References Inkscape::Util::const_char_ptr::data(), and setAttributeImpl().

Referenced by SPGrid::_checkOldGrid(), Inkscape::UI::Dialog::SelectorsDialog::_removeClass(), Inkscape::UI::Dialog::StyleDialog::_writeStyleElement(), Inkscape::UI::Widget::GradientSelector::add_vector_clicked(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), Inkscape::Extension::Internal::SvgBuilder::addSoftMaskedImage(), SPGradient::build(), copyAttribute(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), SPDocument::createDoc(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::UI::Dialog::AttrDialog::deleteAttribute(), Inkscape::LivePathEffect::Effect::doOnBeforeCommit(), file_import(), Inkscape::fixBrokenLinks(), item_to_paths(), Inkscape::LivePathEffect::LPECopyRotate::LPECopyRotate(), Inkscape::LivePathEffect::LPEPowerClip::LPEPowerClip(), Inkscape::UI::Dialog::AttrDialog::nameEdited(), Inkscape::LivePathEffect::LPEMeasureSegments::processObjects(), prune_inkscape_from_node(), rebase_image_href(), Inkscape::Preferences::remove(), SPObject::removeAttribute(), Inkscape::Extension::save(), SPGenericEllipse::set_elliptical_path_attribute(), SPRect::set_rect_path_attribute(), setAttributeSvgNonDefaultDouble(), SPObject::setExportDpi(), sp_attribute_clean_element(), sp_attribute_sort_element(), sp_gradient_repr_set_link(), sp_lpe_item_cleanup_original_path_recursive(), sp_selected_path_create_offset_object(), Inkscape::UI::Tools::spdc_apply_powerstroke_shape(), SPFeComposite::write(), SPTag::write(), SPFeDiffuseLighting::write(), SPFeTurbulence::write(), SPFilter::write(), SPObject::write(), SPMarker::write(), SPGenericEllipse::write(), SPGradient::write(), SPItem::write(), SPLPEItem::write(), SPPath::write(), SPStar::write(), TextTagAttributes::writeSingleAttributeLength(), and TextTagAttributes::writeSingleAttributeVector().

◆ removeChild()

virtual void Inkscape::XML::Node::removeChild ( Node child)
pure virtual

◆ removeObserver()

◆ removeSubtreeObserver()

virtual void Inkscape::XML::Node::removeSubtreeObserver ( NodeObserver observer)
pure virtual

Remove an object from the subtree observers list.

Parameters
observerThe object to be removed

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Preferences::removeObserver(), Inkscape::UI::Dialog::StyleDialog::removeObservers(), and Inkscape::XML::Subtree::~Subtree().

◆ root() [1/2]

virtual Node const * Inkscape::XML::Node::root ( ) const
pure virtual

Implemented in Inkscape::XML::SimpleNode.

◆ root() [2/2]

virtual Node * Inkscape::XML::Node::root ( )
pure virtual

Get the root node of this node's document.

This method works on any node that is part of an XML document, and returns the root node of the document in which it resides. For detached node hierarchies (i.e. nodes that are not descendants of a document node) this method returns the highest-level element node. For detached non-element nodes this method returns NULL.

Returns
A pointer to the root element node, or NULL if the node is detached

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::Preferences::_getNode(), Inkscape::Preferences::_load(), Inkscape::UI::Dialog::DocumentProperties::addEmbeddedScript(), Inkscape::UI::Dialog::DocumentProperties::addExternalScript(), Inkscape::Extension::build_from_reprdoc(), Inkscape::UI::Dialog::CPHistoryXML::CPHistoryXML(), Inkscape::Extension::Internal::Filter::create_and_apply_filter(), create_text_with_rectangle(), SPDocument::createDoc(), SPDocument::createNewDoc(), SPDocument::createNewDocFromMem(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Internal::Filter::filters_load_file(), insert_hatch_polyfill(), insert_mesh_polyfill(), Inkscape::Extension::Loader::load_implementation(), Inkscape::loadImpl(), Inkscape::migrateDetails(), SPItem::moveTo(), SPTag::moveTo(), new_filter_blend_gaussian_blur(), Inkscape::Extension::Implementation::XSLT::open(), Inkscape::Extension::PrefDialog::PrefDialog(), SPDocument::rebase(), Inkscape::Preferences::remove(), remove_marker_context_paint(), show_output(), Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile(), and XmlReprActionTest::XmlReprActionTest().

◆ setAttribute()

void Inkscape::XML::Node::setAttribute ( Util::const_char_ptr  key,
Util::const_char_ptr  value 
)

Change an attribute of this node.

The strings passed to this method are copied, so you can free them after use.

Parameters
keyName of the attribute to change
valueThe new value of the attribute

Definition at line 25 of file node.cpp.

References Inkscape::Util::const_char_ptr::data(), and setAttributeImpl().

Referenced by SPPattern::_chain(), SPGrid::_checkOldGrid(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::SvgBuilder::_createImage(), Inkscape::Extension::Internal::SvgBuilder::_createMask(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::Extension::Internal::SvgBuilder::_flushText(), Inkscape::Extension::Internal::SvgBuilder::_flushTextPath(), Inkscape::UI::Tools::ConnectorTool::_flushWhite(), Inkscape::Extension::Internal::SvgBuilder::_getColorProfile(), Inkscape::Preferences::_getNode(), Inkscape::UI::Dialog::SelectorsDialog::_insertClass(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::UI::Dialog::SelectorsDialog::_removeClass(), Inkscape::Extension::Internal::SvgBuilder::_renderText(), Inkscape::Extension::Internal::SvgBuilder::_setClipPath(), Inkscape::Preferences::_setRawValue(), Inkscape::UI::Tools::TextTool::_setupText(), Inkscape::UI::Toolbar::ArcToolbar::_typeChanged(), Inkscape::Shortcuts::_write(), Inkscape::UI::Dialog::StyleDialog::_writeStyleElement(), Inkscape::LivePathEffect::LPEPowerClip::add(), Inkscape::UI::Dialog::CPHistoryXML::add_action_parameter(), add_actions_processing(), Inkscape::UI::Dialog::SvgFontsDialog::add_kerning_pair(), Inkscape::UI::Widget::GradientSelector::add_vector_clicked(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), Inkscape::Extension::Internal::SvgBuilder::addPath(), Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), Inkscape::Extension::Internal::SvgBuilder::addShadedFill(), Inkscape::Extension::Internal::SvgBuilder::addSoftMaskedImage(), addStop(), Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), SPAttributeTable::attribute_table_entry_changed(), Inkscape::Extension::Internal::SvgBuilder::beginLayer(), Inkscape::Extension::Internal::SvgBuilder::beginMarkedContent(), Inkscape::ObjectSet::breakApart(), SPRoot::build(), SPNamedView::change_bool_setting(), SPNamedView::change_color(), Inkscape::Shortcuts::clear_user_shortcuts(), Inkscape::ObjectSet::clone(), SPHatch::clone_if_necessary(), Inkscape::LivePathEffect::LPECopyRotate::cloneD(), Inkscape::LivePathEffect::LPEMirrorSymmetry::cloneD(), Inkscape::LivePathEffect::LPETiling::cloneD(), Inkscape::ObjectSet::cloneOriginalPathLPE(), Inkscape::ObjectSet::combine(), SPBox3D::convert_to_group(), Box3DSide::convert_to_path(), copyAttribute(), SPMeshNodeArray::create(), SPClipPath::create(), SPMask::create(), create_flowtext_with_internal_frame(), Inkscape::create_layer(), SPGrid::create_new(), SPFont::create_new_glyph(), create_text_with_inline_size(), create_text_with_rectangle(), Persp3D::create_xml_element(), Inkscape::LivePathEffect::Effect::createAndApply(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), SPBox3D::createBox3D(), Box3DSide::createBox3DSide(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPECopyRotate::createPathBase(), Inkscape::LivePathEffect::LPEMirrorSymmetry::createPathBase(), Inkscape::LivePathEffect::LPESlice::createPathBase(), Inkscape::LivePathEffect::LPETiling::createPathBase(), SPGuide::createSPGuide(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::Extension::Internal::SvgBuilder::cropPage(), delete_line_break(), Inkscape::LivePathEffect::LPEBool::divisionit(), SPDocument::do_change_filename(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::LPEBool::doBeforeEffect(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::ArcTool::drag(), Inkscape::UI::Tools::StarTool::drag(), Inkscape::LivePathEffect::LPEBool::dupleNode(), duplicate_node_without_children(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::Extension::Internal::Grid::effect(), file_import(), file_save(), Inkscape::ObjectSet::fillBetweenMany(), filter_add_primitive(), Inkscape::Extension::Internal::Filter::Filter::filters_load_node(), find_references(), Inkscape::LivePathEffect::LPEBool::fractureit(), generate_linked_fill(), generate_marker(), SPFlowtext::getAsText(), Inkscape::Extension::Internal::PdfImportDialog::getImportSettings(), ink_copy_generic_attributes(), insert_hatch_polyfill(), insert_mesh_polyfill(), insert_text_fallback(), SPObject::invoke_build(), item_to_paths(), Inkscape::LivePathEffect::LPECopyRotate::LPECopyRotate(), Inkscape::LivePathEffect::LPETaperStroke::LPETaperStroke(), Inkscape::Extension::InxParameter::make(), Inkscape::Extension::Internal::Filter::merge_filters(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::UI::Tools::MeshTool::new_default(), new_filter_blend_gaussian_blur(), Inkscape::UI::Dialog::new_font(), normalize_all_paths(), Inkscape::Extension::Implementation::Script::PreviewObserver::notifyUndoCommitEvent(), Inkscape::UI::Widget::RegisteredColorPicker::on_changed(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_click_released(), Inkscape::Extension::Internal::GdkpixbufInput::open(), Inkscape::Extension::Internal::Svg::open(), Inkscape::Colors::paint_to_xml(), Inkscape::LivePathEffect::Parameter::param_write_to_repr(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), Inkscape::LivePathEffect::LPEMeasureSegments::processObjects(), SPPattern::produce(), Inkscape::Extension::Internal::SvgBuilder::pushPage(), SPStyle::readFromPrefs(), SPDocument::rebase(), rebase_image_href(), redundant_semi_nesting_processor(), remove_marker_auto_start_reverse(), remove_marker_context_paint(), Inkscape::Extension::save(), Inkscape::Extension::Implementation::Script::PreviewObserver::selectionChanged(), SPGaussianBlur::set_deviation(), set_display_unit(), SPGenericEllipse::set_elliptical_path_attribute(), SPRect::set_rect_path_attribute(), Inkscape::Extension::Internal::SvgBuilder::setAsLayer(), SPObject::setAttribute(), setAttributeBoolean(), setAttributeCssDouble(), setAttributeInt(), setAttributePoint(), setAttributeSvgDouble(), setAttributeSvgLength(), Inkscape::ObjectSet::setClipGroup(), SPStop::setColorRepr(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::setHrefAttribute(), SPObject::setLabel(), Inkscape::UI::Tools::MeasureTool::setLabelText(), SPGrid::setMajorColor(), Inkscape::Extension::Internal::SvgBuilder::setMargins(), Inkscape::UI::Tools::MeasureTool::setMarker(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), Inkscape::ObjectSet::setMask(), Inkscape::UI::Tools::MeasureTool::setMeasureItem(), SPGrid::setMinorColor(), SPGrid::setSVGType(), SPGrid::setType(), SPGrid::setUnit(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), Inkscape::BooleanBuilder::shape_commit(), sp_attribute_sort_element(), sp_document_default_gradient_vector(), sp_gradient_convert_to_userspace(), sp_gradient_fork_private_if_necessary(), sp_gradient_get_private_normalized(), sp_gradient_reset_to_userspace(), sp_group_perform_patheffect(), Inkscape::LivePathEffect::sp_inverse_powerclip(), Inkscape::LivePathEffect::sp_inverse_powermask(), sp_item_list_to_curves(), sp_lpe_item_cleanup_original_path_recursive(), sp_marker_fork_if_necessary(), sp_namedview_document_from_window(), sp_repr_document_new(), sp_repr_svg_read_node(), sp_selected_item_to_curved_repr(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), Inkscape::UI::Tools::sp_spray_recursive(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), sp_tref_convert_to_tspan(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), Inkscape::UI::Tools::spdc_apply_powerstroke_shape(), Inkscape::UI::Tools::spdc_apply_simplify(), Inkscape::UI::Tools::spdc_create_single_dot(), Inkscape::UI::Tools::spdc_flush_white(), Inkscape::UI::Tools::spdc_paste_curve_as_freehand_shape(), Inkscape::SelTrans::stamp(), Inkscape::Extension::Internal::SvgBuilder::SvgBuilder(), text_flow_into_shape(), text_put_on_path(), text_unflow(), Inkscape::ObjectSet::tile(), Inkscape::UI::Dialog::LivePathEffectEditor::toggleVisible(), Inkscape::ObjectSet::toSymbol(), Inkscape::LivePathEffect::LPEPowerMask::tryForkMask(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), SPUse::unlink(), Inkscape::ObjectSet::unsetMask(), SPSymbol::unSymbol(), SPShape::update_patheffect(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), SPFeComposite::write(), SPTag::write(), SPFeBlend::write(), SPFeDisplacementMap::write(), SPFilter::write(), SPObject::write(), Persp3D::write(), SPStyleElem::write(), SPText::write(), SPMarker::write(), SPAnchor::write(), SPOffset::write(), Box3DSide::write(), SPBox3D::write(), SPGenericEllipse::write(), SPGradient::write(), SPImage::write(), SPGroup::write(), SPItem::write(), SPMeshGradient::write(), SPPath::write(), SPPolygon::write(), SPRect::write(), SPRoot::write(), SPSpiral::write(), SPStar::write(), SPSymbol::write(), SPMeshNodeArray::write(), SPViewBox::write_preserveAspectRatio(), Inkscape::UI::Widget::RegisteredWidget< W >::write_to_xml(), SPViewBox::write_viewBox(), SPDimensions::writeDimensions(), SPConnEndPair::writeRepr(), TextTagAttributes::writeSingleAttributeLength(), TextTagAttributes::writeTo(), and Inkscape::UI::PathManipulator::writeXML().

◆ setAttributeBoolean()

◆ setAttributeCssDouble()

◆ setAttributeImpl()

virtual void Inkscape::XML::Node::setAttributeImpl ( char const *  key,
char const *  value 
)
protectedpure virtual

◆ setAttributeInt()

bool Inkscape::XML::Node::setAttributeInt ( Util::const_char_ptr  key,
int  val 
)

◆ setAttributeOrRemoveIfEmpty()

void Inkscape::XML::Node::setAttributeOrRemoveIfEmpty ( Inkscape::Util::const_char_ptr  key,
Inkscape::Util::const_char_ptr  value 
)

Change an attribute of this node.

Empty string deletes the attribute.

Parameters
keyName of the attribute to change
valueThe new value of the attribute

Definition at line 167 of file node.cpp.

References Inkscape::Util::const_char_ptr::data(), and setAttributeImpl().

Referenced by Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::SvgBuilder::_createImage(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::Extension::Internal::SvgBuilder::_getColorProfile(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::Extension::Internal::SvgBuilder::_setBlendMode(), Inkscape::UI::Dialog::DocumentProperties::addExternalScript(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), Inkscape::ObjectSet::breakApart(), Inkscape::ObjectSet::cloneOriginalPathLPE(), SPBox3D::convert_to_group(), create_flowtext_with_internal_frame(), create_text_with_rectangle(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), Inkscape::ObjectSet::createBitmapCopy(), Inkscape::ColorProfile::createFromProfile(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), delete_line_break(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::Effect::doOnBeforeCommit(), Inkscape::fixBrokenLinks(), SPFlowtext::getAsText(), insert_text_fallback(), Inkscape::UI::Dialog::AttrDialog::nameEdited(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_click_released(), Inkscape::Colors::paint_to_xml(), Inkscape::LivePathEffect::LPEMeasureSegments::processObjects(), SPPattern::produce(), rebase_image_href(), SPTSpan::set(), SPNamedView::setDisplayUnit(), SPObject::setExportFilename(), sp_attribute_clean_style(), sp_attribute_sort_style(), sp_import_document(), sp_repr_css_set(), sp_selected_item_to_curved_repr(), Inkscape::UI::Tools::spdc_apply_simplify(), Inkscape::Extension::Internal::svgSetTransform(), text_to_glyphs(), Inkscape::ObjectSet::tile(), Inkscape::LivePathEffect::LPEMirrorSymmetry::toMirror(), Inkscape::UI::Dialog::AttrDialog::valueEdited(), SPFeComposite::write(), SPFeBlend::write(), SPFeDiffuseLighting::write(), SPFeDisplacementMap::write(), SPFilterPrimitive::write(), SPFeSpecularLighting::write(), SPFilter::write(), SPTagUse::write(), SPObject::write(), LivePathEffectObject::write(), Inkscape::ColorProfile::write(), SPPage::write(), SPBox3D::write(), SPGradient::write(), SPItem::write(), SPLPEItem::write(), SPUse::write(), and TextTagAttributes::writeSingleAttributeVector().

◆ setAttributePoint()

bool Inkscape::XML::Node::setAttributePoint ( Util::const_char_ptr  key,
Geom::Point const &  val 
)

◆ setAttributeSvgDouble()

bool Inkscape::XML::Node::setAttributeSvgDouble ( Util::const_char_ptr  key,
double  val 
)

For attributes where an exponent is allowed.

Not suitable for property attributes (fill-opacity, font-size etc.).

Definition at line 111 of file node.cpp.

References setAttribute(), and Inkscape::SVGOStringStream::str().

Referenced by Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::SvgBuilder::_createImage(), Inkscape::Extension::Internal::SvgBuilder::_createMask(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::UI::Tools::TextTool::_setupText(), Inkscape::UI::Toolbar::SpiralToolbar::_valueChanged(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::UI::Dialog::CloneTiler::apply(), SPMeshNodeArray::create(), create_text_with_inline_size(), create_text_with_rectangle(), Inkscape::ObjectSet::createBitmapCopy(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), SPImage::cropToArea(), GrDrag::deleteSelected(), InkFileExportCmd::do_export_vector(), generate_marker(), SPFlowtext::getAsText(), Inkscape::Extension::Internal::PdfImportDialog::getImportSettings(), insert_text_fallback(), modify_filter_gaussian_blur_from_item(), new_filter_blend_gaussian_blur(), new_filter_gaussian_blur(), Inkscape::PageManager::newPage(), Inkscape::Extension::Internal::GdkpixbufInput::open(), Inkscape::Colors::paint_to_xml(), SPPattern::produce(), Inkscape::Extension::Internal::SvgBuilder::pushPage(), Inkscape::UI::Toolbar::StarToolbar::randomized_value_changed(), Inkscape::UI::Toolbar::StarToolbar::rounded_value_changed(), SPFilter::set_filter_region(), SPGrid::setAngleX(), SPGrid::setAngleZ(), setAttributeSvgNonDefaultDouble(), Inkscape::Extension::Internal::SvgBuilder::setDocumentSize(), SPObject::setExportDpi(), Inkscape::Extension::Internal::SvgBuilder::setGroupOpacity(), Inkscape::UI::Tools::MeasureTool::setLabelText(), SPGrid::setMajorColor(), SPGrid::setMinorColor(), SPGrid::setOrigin(), SPGrid::setPrefValues(), SPGrid::setSpacing(), sp_gradient_convert_to_userspace(), sp_gradient_reset_to_userspace(), sp_item_gradient_set_coords(), sp_namedview_document_from_window(), sp_selected_path_create_offset_object(), sp_textpath_to_text(), Inkscape::UI::Tools::spdc_create_single_dot(), text_to_glyphs(), text_unflow(), Inkscape::ObjectSet::tile(), SPImage::update(), SPFeComposite::write(), SPFeDisplacementMap::write(), SPFilter::write(), SPFontFace::write(), SPFont::write(), SPTextPath::write(), SPMarker::write(), SPPage::write(), SPOffset::write(), SPGenericEllipse::write(), SPImage::write(), SPItem::write(), SPLine::write(), SPLinearGradient::write(), SPMeshGradient::write(), SPRadialGradient::write(), SPRoot::write(), SPSpiral::write(), SPStar::write(), and SPMeshNodeArray::write().

◆ setAttributeSvgLength()

bool Inkscape::XML::Node::setAttributeSvgLength ( Util::const_char_ptr  key,
SVGLength const &  val 
)

Definition at line 131 of file node.cpp.

References setAttribute(), and SVGLength::write().

Referenced by SPGenericEllipse::write(), and SPRect::write().

◆ setAttributeSvgNonDefaultDouble()

bool Inkscape::XML::Node::setAttributeSvgNonDefaultDouble ( Util::const_char_ptr  key,
double  val,
double  default_value 
)

Definition at line 122 of file node.cpp.

References removeAttribute(), and setAttributeSvgDouble().

Referenced by sp_namedview_document_from_window().

◆ setCodeUnsafe()

virtual void Inkscape::XML::Node::setCodeUnsafe ( int  code)
pure virtual

Set the integer GQuark code for the name of the node.

Do not use this function unless you really have a good reason.

Parameters
codeThe integer value corresponding to the string to be set as the name of this node

Implemented in Inkscape::XML::SimpleNode.

Referenced by SPGenericEllipse::write(), and SPRect::write().

◆ setContent()

◆ setPosition()

virtual void Inkscape::XML::Node::setPosition ( int  pos)
pure virtual

Set the position of this node in parent's child order.

To move the node to the end of the parent's child order, pass a negative argument.

Parameters
posThe new position in parent's child order

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::PathManipulator::_createControlPointsFromGeometry(), SPBox3D::convert_to_group(), Inkscape::UI::Tools::do_trace(), item_to_paths(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_drag_end(), Inkscape::UI::NodeList::reverse(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), and sp_lpe_item_cleanup_original_path_recursive().

◆ synthesizeEvents()

virtual void Inkscape::XML::Node::synthesizeEvents ( NodeObserver observer)
pure virtual

Generate a sequence of events corresponding to the state of this node.

This function notifies the specified observer of all the events that would recreate the current state of this node; e.g. the observer is notified of all the attributes, children and content like they were just created. This function can greatly simplify observer logic.

Parameters
observerThe node observer to notify of the events

Implemented in Inkscape::XML::SimpleNode.

Referenced by Inkscape::UI::Toolbar::SpiralToolbar::_selectionChanged(), Inkscape::UI::Toolbar::StarToolbar::_selectionChanged(), and Inkscape::UI::Dialog::AttrDialog::setRepr().

◆ type()

virtual NodeType Inkscape::XML::Node::type ( ) const
pure virtual

Get the type of the node.

Returns
NodeType enumeration member corresponding to the type of the node.

Implemented in Inkscape::XML::CommentNode, Inkscape::XML::ElementNode, Inkscape::XML::PINode, Inkscape::XML::SimpleDocument, and Inkscape::XML::TextNode.

Referenced by Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), duplicate_node_without_children(), find_references(), Inkscape::Extension::Internal::gatherText(), Inkscape::UI::Dialog::get_first_style_text_node(), NodeTraits::get_type_string(), Inkscape::XML::id_permitted(), is_text_or_comment_node(), Inkscape::UI::Dialog::XmlTree::on_tree_select_row_enable(), Inkscape::Extension::ParamNotebook::ParamNotebook(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::ParamNotebookPage(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), Inkscape::UI::Dialog::XmlTree::propagate_tree_select(), prune_inkscape_from_node(), Inkscape::XML::SimpleNode::root(), SPObject::set(), Inkscape::UI::Dialog::XmlTree::set_dt_select(), Inkscape::UI::MultiPathManipulator::setNodeType(), sp_attribute_clean_element(), sp_attribute_clean_recursive(), sp_attribute_clean_style(), sp_attribute_clean_style(), sp_attribute_sort_element(), sp_attribute_sort_recursive(), sp_attribute_sort_style(), sp_repr_do_read(), sp_repr_is_meta_element(), sp_repr_save_writer(), sp_repr_svg_read_node(), sp_repr_write_stream(), SPObject::textualContent(), tidy_operator_repeated_spans(), Inkscape::FontLister::update_font_data_recursive(), Inkscape::Extension::WidgetBox::WidgetBox(), Inkscape::Extension::WidgetLabel::WidgetLabel(), and SPObject::write().

Friends And Related Symbol Documentation

◆ next_node()

Node * next_node ( Node node)
related

Get the next node in sibling order.

Parameters
nodeThe origin node
Returns
The next node in sibling order

Definition at line 31 of file node-fns.h.

References next(), and node.

◆ parent_node()

Node * parent_node ( Node node)
related

Get the node's parent.

Parameters
nodeThe origin node
Returns
The node's parent

Definition at line 63 of file node-fns.h.

References node, and parent().

◆ previous_node()

Node * previous_node ( Node node)
related

Get the previous node in sibling order.

This method, unlike Node::next(), is a linear search over the children of node's parent. The return value is NULL when the node has no parent or is first in the sibling order.

Parameters
nodeThe origin node
Returns
The previous node in sibling order, or NULL

Definition at line 69 of file node-fns.cpp.

References node, and prev().

◆ sp_repr_lookup_child()

Inkscape::XML::Node * sp_repr_lookup_child ( Inkscape::XML::Node repr,
gchar const *  key,
gchar const *  value 
)
related

Find an element node using an unique attribute.

This function returns the first child of the specified node that has the attribute key equal to value. Note that this function does not recurse.

Parameters
reprThe node to start from
keyThe name of the attribute to use for comparisons
valueThe value of the attribute to look for

Definition at line 315 of file repr-util.cpp.

References child, firstChild(), and key.

Referenced by Inkscape::XML::SimpleNode::cleanOriginal(), and Inkscape::XML::SimpleNode::mergeFrom().

◆ sp_repr_lookup_name()

Inkscape::XML::Node * sp_repr_lookup_name ( Inkscape::XML::Node repr,
char const *  name,
int  maxdepth = -1 
)
related

Find an element node with the given name.

This function searches the descendants of the specified node depth-first for the first XML node with the specified name.

Parameters
reprThe node to start from
nameThe name of the element node to find
maxdepthMaximum search depth, or -1 for an unlimited depth
Returns
A pointer to the matching Inkscape::XML::Node

◆ sp_repr_visit_descendants() [1/2]

template<typename Visitor >
void sp_repr_visit_descendants ( Inkscape::XML::Node a,
Inkscape::XML::Node b,
Visitor  visitor 
)
related

Visit descendants of 2 nodes in parallel.

The assumption is that one a and b trees are the same in terms of structure (like one is a duplicate of the other).

Parameters
afirst node tree root
bsecond node tree root
visitorThe visitor lambda (Node *, Node *) -> bool If visitor returns false child nodes are not visited.

Definition at line 219 of file repr.h.

References firstChild(), and sp_repr_visit_descendants().

◆ sp_repr_visit_descendants() [2/2]

template<typename Visitor >
void sp_repr_visit_descendants ( Inkscape::XML::Node node,
Visitor  visitor 
)
related

Visit all descendants recursively.

Traverse all descendants of node and call visitor on it. Stop descending when visitor returns false

Parameters
nodeThe root node to start visiting
visitorThe visitor lambda (Node *) -> bool If visitor returns false child nodes of current node are not visited.

Definition at line 196 of file repr.h.

References child, firstChild(), node, and sp_repr_visit_descendants().


The documentation for this class was generated from the following files: