Inkscape
Vector Graphics Editor
|
Interface for refcounted XML nodes. More...
#include <node.h>
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 AttributeVector & | attributeList () 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 Document * | document ()=0 |
Get the node's associated document. | |
virtual Document const * | document () const =0 |
virtual Node * | root ()=0 |
Get the root node of this node's document. | |
virtual Node const * | root () const =0 |
virtual Node * | parent ()=0 |
Get the parent of this node. | |
virtual Node const * | parent () const =0 |
virtual Node * | next ()=0 |
Get the next sibling of this node. | |
virtual Node const * | next () const =0 |
virtual Node * | prev ()=0 |
virtual Node const * | prev () const =0 |
virtual Node * | firstChild ()=0 |
Get the first child of this node. | |
virtual Node const * | firstChild () const =0 |
virtual Node * | lastChild ()=0 |
Get the last child of this node. | |
virtual Node const * | lastChild () const =0 |
virtual Node * | nthChild (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 Node * | duplicate (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. | |
![]() | |
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.) | |
Node * | next_node (Node *node) |
Get the next node in sibling order. | |
Node * | previous_node (Node *node) |
Get the previous node in sibling order. | |
Node * | parent_node (Node *node) |
Get the node's parent. | |
Inkscape::XML::Node * | sp_repr_lookup_child (Inkscape::XML::Node *repr, gchar const *key, gchar const *value) |
Find an element node using an unique attribute. | |
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. | |
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 > | |
Node * | findChildPath (T list) |
depth first search to find a node | |
template<typename iterT > | |
Node * | findChildPath (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 | |
![]() | |
Anchored () | |
virtual | ~Anchored ()=default |
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.
|
default |
|
overridedefault |
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.
child | The node to insert |
after | The 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().
|
inline |
Insert another node as a child of this node.
This is more efficient than appendChild() + setPosition().
child | The node to insert |
pos | The 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().
|
pure virtual |
Add an object that will be notified of the changes to this node.
observer
must be an object deriving from the NodeObserver class. The virtual methods of this object will be called when a corresponding change happens to this node. You can also notify the observer of the node's current state using synthesizeEvents(NodeObserver &).
observer | The observer object |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Toolbar::SpiralToolbar::_attachRepr(), Inkscape::UI::Toolbar::StarToolbar::_attachRepr(), Inkscape::UI::Toolbar::Box3DToolbar::_attachRepr(), Inkscape::UI::Toolbar::ArcToolbar::_attachRepr(), Inkscape::UI::Toolbar::RectToolbar::_attachRepr(), Inkscape::UI::Dialog::SelectorsDialog::_getStyleTextNode(), Inkscape::UI::Dialog::StyleDialog::_getStyleTextNode(), Inkscape::Preferences::addObserver(), LivePathEffectObject::build(), Persp3D::build(), SPStyleElem::build(), Inkscape::UI::Dialog::DocumentProperties::WatchConnection::connect(), SPObject::invoke_build(), Inkscape::XML::SignalObserver::set(), Inkscape::UI::ShapeEditor::set_item(), Inkscape::UI::Toolbar::ConnectorToolbar::setDesktop(), and Inkscape::UI::Dialog::AttrDialog::setRepr().
|
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.
observer | The observer object |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Preferences::addObserver(), Inkscape::UI::Dialog::StyleDialog::documentReplaced(), and Inkscape::XML::Subtree::Subtree().
|
pure virtual |
Append a node as the last child of this node.
child | The 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().
|
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
key | The 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().
|
pure virtual |
Get a list of the node's attributes.
The returned list is a functional programming style list rather than a standard one.
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Dialog::SelectorsDialog::_addToSelector(), css_attrs_are_equal(), delete_line_break(), duplicate_node_without_children(), Inkscape::XML::SimpleNode::equal(), file_import(), Inkscape::Preferences::getAllEntries(), Inkscape::Extension::Input::Input(), insert_text_fallback(), Inkscape::UI::Dialog::Find::item_attrvalue_match(), Inkscape::Extension::Internal::Filter::merge_filters(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::Extension::Output::Output(), Inkscape::Extension::ProcessingAction::ProcessingAction(), prune_inkscape_from_node(), SPDocument::rebase(), remove_marker_auto_start_reverse(), sp_attribute_clean_element(), sp_attribute_clean_style(), sp_attribute_sort_element(), sp_repr_write_stream(), sp_repr_write_stream_root_element(), GrDrag::styleSet(), and Inkscape::Extension::TemplatePreset::TemplatePreset().
|
inline |
Iterator over children.
Definition at line 557 of file node.h.
References firstChild().
Referenced by Avoid::IncSolver::blockGraphIsCyclic(), vpsc::Solver::blockGraphIsCyclic(), Avoid::IncSolver::constraintGraphIsCyclic(), vpsc::Solver::constraintGraphIsCyclic(), Avoid::HyperedgeImprover::createShiftSegmentsForDimensionExcluding(), and Avoid::HyperedgeImprover::moveJunctionsAlongCommonEdges().
Move a given node in this node's child order.
Both child
and after
must be children of this node for the method to work.
child | The node to move in the order |
after | The sibling node after which the moved node should be placed |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Dialog::XmlTree::cmd_lower_node(), Inkscape::UI::Dialog::XmlTree::cmd_raise_node(), Inkscape::ObjectSet::lower(), SPItem::lowerOne(), SPItem::lowerToBottom(), SPItem::moveTo(), SPTag::moveTo(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), Inkscape::ObjectSet::raise(), SPItem::raiseOne(), SPItem::raiseToTop(), Inkscape::UI::Dialog::rename_glyph_layer(), SPPage::setPageIndex(), and XmlReprActionTest::testRollbackOfNodeReordering().
|
pure virtual |
Get the number of children of this node.
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), SPFlowtext::getAsText(), insert_text_fallback(), move_child_nodes(), remove_filter_gaussian_blur(), and SPFont::sort_glyphs().
|
pure virtual |
Remove all elements that not in src node.
src | The node to check for elements into this node |
key | The attribute to use as the identity attribute |
|
pure virtual |
Get the integer code corresponding to the node's 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().
|
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.
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().
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.
key | Name of the attribute to change |
source_node | Node from which to take the attribute value |
remove_if_empty | If 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. |
Definition at line 30 of file node.cpp.
References attribute(), key, removeAttribute(), and setAttribute().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
pure virtual |
Get the node's associated document.
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Preferences::_getNode(), Inkscape::XML::SimpleNode::addChild(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::ObjectSet::breakApart(), Inkscape::XML::SimpleNode::changeOrder(), Inkscape::Application::crash_handler(), SPBox3D::createBox3D(), delete_line_break(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::duplicate_filter(), Inkscape::UI::Dialog::FilterEffectsDialog::duplicate_primitive(), Inkscape::UI::Dialog::get_first_style_text_node(), ink_copy_generic_children(), insert_hatch_polyfill(), insert_mesh_polyfill(), insert_text_fallback(), redundant_semi_nesting_processor(), remove_marker_auto_start_reverse(), remove_marker_context_paint(), Inkscape::XML::SimpleNode::removeChild(), Inkscape::AutoSave::save(), Inkscape::Extension::Implementation::XSLT::save(), Inkscape::Extension::Implementation::Script::PreviewObserver::selectionChanged(), sp_gradient_add_stop(), sp_gradient_reverse_vector(), sp_item_group_ungroup(), sp_selected_item_to_curved_repr(), sp_te_insert(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), sp_textpath_to_text(), sp_vector_add_stop(), Inkscape::SelTrans::stamp(), SPObject::updateRepr(), verify_grad(), and SPMeshNodeArray::write().
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.
doc | The document in which the duplicate should be created |
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().
|
inline |
Helper to use the standard lib container functions.
Definition at line 559 of file node.h.
Referenced by Avoid::HyperedgeImprover::createShiftSegmentsForDimensionExcluding(), and findChildPath().
|
pure virtual |
Compare 2 nodes equality.
other | The other node to compare |
recursive | Recursive mode check |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::XML::SimpleNode::mergeFrom().
|
inline |
template reshuffling to make the more useful findChildPath cleaner
Definition at line 582 of file node.h.
References child, end(), and findChildPath().
|
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().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
pure virtual |
Get the first child of this node.
For nodes without any children, this method returns 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().
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.
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().
double Inkscape::XML::Node::getAttributeDouble | ( | Util::const_char_ptr | key, |
double | default_value = 0.0 |
||
) | const |
Definition at line 76 of file node.cpp.
References attribute(), and Inkscape::Util::const_char_ptr::data().
Referenced by Inkscape::UI::Toolbar::SpiralToolbar::_update(), Inkscape::Extension::Internal::PdfInput::add_builder_page(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::UI::Dialog::Print::draw_page(), InkFileExportCmd::get_bgcolor(), SPText::get_frame(), Inkscape::UI::Dialog::get_number(), SPObject::getExportDpi(), insert_text_fallback(), Inkscape::UI::Toolbar::StarToolbar::notifyAttributeChanged(), Inkscape::UI::Toolbar::StarToolbar::proportion_value_changed(), and Inkscape::UI::Dialog::ObjectProperties::update_entries().
int Inkscape::XML::Node::getAttributeInt | ( | Util::const_char_ptr | key, |
int | default_value = 0 |
||
) | const |
Definition at line 67 of file node.cpp.
References attribute(), and Inkscape::Util::const_char_ptr::data().
Referenced by Inkscape::Extension::Internal::PdfInput::add_builder_page(), SPObject::getIntAttribute(), and Inkscape::UI::Toolbar::StarToolbar::notifyAttributeChanged().
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().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
pure virtual |
Get the last child of this node.
For nodes without any children, this method returns NULL.
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Extension::Internal::SvgBuilder::_createMask(), Inkscape::Extension::Internal::SvgBuilder::addShadedFill(), Inkscape::UI::Dialog::CPHistoryXML::CPHistoryXML(), SPMask::create(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::UI::Dialog::CPHistoryXML::get_action_parameter_history(), Inkscape::UI::Dialog::CPHistoryXML::get_last_operation(), Inkscape::Extension::Internal::SvgBuilder::mergePath(), move_child_nodes(), SPDocument::rebase(), Inkscape::Extension::Internal::SvgBuilder::shouldMergePath(), sp_import_document(), sp_item_group_ungroup(), and Inkscape::ObjectSet::toLayer().
|
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".
partial_name | The string to match against all attributes |
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().
|
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.
src | The node to merge into this node |
key | The attribute to use as the identity attribute |
noid | If true process noid items |
key | If 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().
|
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.
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().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
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.
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().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
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.
index | The zero-based index of the child to retrieve |
Implemented in Inkscape::XML::SimpleNode.
Referenced by addChildAtPos(), and Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply().
|
inline |
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
pure virtual |
Get the parent of this node.
This method will return NULL for detached nodes.
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().
|
pure virtual |
Get the index of this node in parent's child order.
If this method is used on a node that doesn't have a parent, the method will return 0, and a warning will be printed on the console.
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::PathManipulator::_bsplineHandlePosition(), Inkscape::UI::PathManipulator::_bsplineHandleReposition(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::ObjectSet::breakApart(), Inkscape::ObjectSet::combine(), Inkscape::UI::PathManipulator::copySelectedPath(), SPObject::getPosition(), Inkscape::ObjectSet::group(), item_to_paths(), Inkscape::XML::SimpleNode::mergeFrom(), Inkscape::UI::NodeList::reverse(), sp_item_list_to_curves(), sp_repr_compare_position(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), and Inkscape::UI::Tools::sp_tweak_dilate_recursive().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Dialog::CPHistoryXML::get_action_parameter_history(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), previous_node(), SPDocument::rebase(), sp_item_group_ungroup(), Inkscape::SelTrans::stamp(), and Inkscape::ObjectSet::toLayer().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
inline |
Remove an attribute of this node.
key | Name 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().
|
pure virtual |
Remove a child of this node.
Once the pointer to the removed node disappears from the stack, the removed node will be collected in the next GC pass, but only as long as its refcount is zero. You should keep a refcount of zero for all nodes in the document except for the document node itself, because they will be held in memory by the parent.
child | The child to remove |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Extension::Internal::SvgBuilder::applyOptionalMask(), Inkscape::UI::Dialog::XmlTree::cmd_indent_node(), delete_line_break(), GrDrag::deleteSelected(), gr_knot_clicked_handler(), insert_text_fallback(), item_to_paths(), move_child_nodes(), SPItem::moveTo(), SPTag::moveTo(), Inkscape::UI::Widget::XmlTreeView::on_drag_drop(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), prune_inkscape_from_node(), prune_proprietary_from_node(), SPDocument::rebase(), recursively_apply_style(), Inkscape::Preferences::remove(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), SPFont::sort_glyphs(), sp_gradient_delete_stop(), sp_lpe_item_cleanup_original_path_recursive(), sp_repr_unparent(), sp_te_set_repr_text_multiline(), sp_textpath_to_text(), Inkscape::UI::Tools::spdc_flush_white(), split_text_object_tree_at(), text_put_on_path(), tidy_operator_repeated_spans(), Inkscape::ObjectSet::toSymbol(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), SPSymbol::unSymbol(), and Inkscape::Extension::Effect::~Effect().
|
pure virtual |
Remove an object from the list of observers.
observer | The object to be removed |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Toolbar::ArcToolbar::_detachRepr(), Inkscape::UI::Toolbar::Box3DToolbar::_detachRepr(), Inkscape::UI::Toolbar::RectToolbar::_detachRepr(), Inkscape::UI::Toolbar::SpiralToolbar::_detachRepr(), Inkscape::UI::Toolbar::StarToolbar::_detachRepr(), Inkscape::UI::Dialog::SelectorsDialog::_getStyleTextNode(), Inkscape::UI::Dialog::StyleDialog::_getStyleTextNode(), Inkscape::UI::Tools::ConnectorTool::cc_clear_active_conn(), Inkscape::UI::Tools::ConnectorTool::cc_clear_active_shape(), LivePathEffectObject::release(), Persp3D::release(), SPStyleElem::release(), SPObject::releaseReferences(), Inkscape::Preferences::removeObserver(), Inkscape::UI::Dialog::StyleDialog::removeObservers(), Inkscape::XML::SignalObserver::set(), Inkscape::UI::Toolbar::ConnectorToolbar::setDesktop(), Inkscape::UI::Dialog::AttrDialog::setRepr(), Inkscape::UI::ShapeEditor::unset_item(), and Inkscape::UI::PathManipulator::writeXML().
|
pure virtual |
Remove an object from the subtree observers list.
observer | The object to be removed |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::Preferences::removeObserver(), Inkscape::UI::Dialog::StyleDialog::removeObservers(), and Inkscape::XML::Subtree::~Subtree().
|
pure virtual |
Implemented in Inkscape::XML::SimpleNode.
|
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.
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().
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.
key | Name of the attribute to change |
value | The 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().
bool Inkscape::XML::Node::setAttributeBoolean | ( | Util::const_char_ptr | key, |
bool | val | ||
) |
Definition at line 86 of file node.cpp.
References setAttribute().
Referenced by Inkscape::Extension::Internal::PdfImportDialog::getImportSettings(), SPNamedView::set_origin_follows_page(), SPNamedView::set_y_axis_down(), SPGrid::setDotted(), SPGrid::setEnabled(), SPNamedView::setLockGuides(), SPNamedView::setShowGrids(), SPNamedView::setShowGuides(), SPGrid::setSnapToVisibleOnly(), SPGrid::setVisible(), and SPStar::write().
bool Inkscape::XML::Node::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.
Definition at line 102 of file node.cpp.
References setAttribute(), and Inkscape::CSSOStringStream::str().
Referenced by Inkscape::Extension::Internal::SvgBuilder::_addStopToGradient(), SPNamedView::change_color(), GrDrag::deleteSelected(), gr_knot_clicked_handler(), Inkscape::UI::Widget::RegisteredColorPicker::on_changed(), Inkscape::Colors::paint_to_xml(), SPGradient::repr_write_vector(), sp_repr_set_css_double(), sp_vector_add_stop(), SPFeDiffuseLighting::write(), SPFeDistantLight::write(), SPFePointLight::write(), SPFeSpecularLighting::write(), SPFeSpotLight::write(), SPStop::write(), and SPMarker::write().
|
protectedpure virtual |
Implemented in Inkscape::XML::SimpleNode.
Referenced by removeAttribute(), setAttribute(), and setAttributeOrRemoveIfEmpty().
bool Inkscape::XML::Node::setAttributeInt | ( | Util::const_char_ptr | key, |
int | val | ||
) |
Definition at line 92 of file node.cpp.
References c, and setAttribute().
Referenced by Inkscape::UI::Toolbar::StarToolbar::magnitude_value_changed(), SPGrid::setMajorLineInterval(), sp_namedview_document_from_window(), Box3DSide::write(), and SPStar::write().
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.
key | Name of the attribute to change |
value | The 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().
bool Inkscape::XML::Node::setAttributePoint | ( | Util::const_char_ptr | key, |
Geom::Point const & | val | ||
) |
Definition at line 137 of file node.cpp.
References setAttribute(), Inkscape::SVGOStringStream::str(), Geom::X, and Geom::Y.
Referenced by SPGuide::createSPGuide(), SPGuide::moveto(), and SPGuide::set_normal().
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().
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().
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().
|
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.
code | The 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().
|
pure virtual |
Set the content of a text or comment node.
This method doesn't make sense for element nodes.
value | The node's new content |
Implemented in Inkscape::XML::SimpleNode.
Referenced by Inkscape::UI::Dialog::SelectorsDialog::_writeStyleElement(), Inkscape::UI::Dialog::StyleDialog::_writeStyleElement(), Inkscape::UI::Dialog::CPHistoryXML::add_operation(), Inkscape::UI::Dialog::AttrDialog::AttrDialog(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), erase_from_spstring(), sp_repr_svg_read_node(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), tidy_operator_repeated_spans(), and tidy_operator_styled_whitespace().
|
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.
pos | The 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().
|
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.
observer | The 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().
|
pure virtual |
Get 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().
Get the next node in sibling order.
node | The origin node |
Definition at line 31 of file node-fns.h.
Get the node's parent.
node | The origin node |
Definition at line 63 of file node-fns.h.
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.
node | The origin node |
Definition at line 69 of file node-fns.cpp.
|
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.
repr | The node to start from |
key | The name of the attribute to use for comparisons |
value | The 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().
|
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.
repr | The node to start from |
name | The name of the element node to find |
maxdepth | Maximum search depth, or -1 for an unlimited depth |
|
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).
a | first node tree root |
b | second node tree root |
visitor | The 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().
|
related |
Visit all descendants recursively.
Traverse all descendants of node and call visitor on it. Stop descending when visitor returns false
node | The root node to start visiting |
visitor | The 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().