Inkscape
Vector Graphics Editor
|
Miscellaneous helpers for reprs. More...
Go to the source code of this file.
Functions | |
static void | sp_xml_ns_register_defaults () |
static char * | sp_xml_ns_auto_prefix (char const *uri) |
gchar const * | sp_xml_ns_uri_prefix (gchar const *uri, gchar const *suggested) |
gchar const * | sp_xml_ns_prefix_uri (gchar const *prefix) |
int | sp_repr_compare_position (Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) |
Works for different-parent objects, so long as they have a common ancestor. | |
bool | sp_repr_compare_position_bool (Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) |
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 const * | sp_repr_lookup_descendant (Inkscape::XML::Node const *repr, gchar const *key, gchar const *value) |
Recursive version of sp_repr_lookup_child(). | |
Inkscape::XML::Node * | sp_repr_lookup_descendant (Inkscape::XML::Node *repr, gchar const *key, gchar const *value) |
Inkscape::XML::Node const * | sp_repr_lookup_name (Inkscape::XML::Node const *repr, gchar const *name, gint maxdepth) |
Glib::ustring | sp_repr_lookup_content (Inkscape::XML::Node const *repr, gchar const *name, Glib::ustring otherwise) |
Inkscape::XML::Node * | sp_repr_lookup_name (Inkscape::XML::Node *repr, gchar const *name, gint maxdepth) |
std::vector< Inkscape::XML::Node const * > | sp_repr_lookup_name_many (Inkscape::XML::Node const *repr, gchar const *name, gint maxdepth) |
std::vector< Inkscape::XML::Node * > | sp_repr_lookup_property_many (Inkscape::XML::Node *repr, Glib::ustring const &property, Glib::ustring const &value, int maxdepth) |
bool | sp_repr_is_meta_element (const Inkscape::XML::Node *node) |
Determine if the node is a 'title', 'desc' or 'metadata' element. | |
Variables | |
static SPXMLNs * | namespaces =nullptr |
SPXMLNs. | |
Miscellaneous helpers for reprs.
Definition in file repr-util.cpp.
int sp_repr_compare_position | ( | Inkscape::XML::Node const * | first, |
Inkscape::XML::Node const * | second | ||
) |
Works for different-parent objects, so long as they have a common ancestor.
Return value: 0 positions are equivalent 1 first object's position is greater than the second -1 first object's position is less than the second
Definition at line 249 of file repr-util.cpp.
References find_containing_child(), lowest_common_ancestor(), Inkscape::XML::Node::parent(), and Inkscape::XML::Node::position().
Referenced by sp_item_repr_compare_position(), sp_item_repr_compare_position_bool(), sp_object_compare_position(), and sp_repr_compare_position_bool().
bool sp_repr_compare_position_bool | ( | Inkscape::XML::Node const * | first, |
Inkscape::XML::Node const * | second | ||
) |
Definition at line 299 of file repr-util.cpp.
References sp_repr_compare_position().
Referenced by Inkscape::ObjectSet::_pathBoolOp(), Inkscape::ObjectSet::clone(), Inkscape::ObjectSet::duplicate(), Inkscape::ObjectSet::group(), Inkscape::ObjectSet::lowerToBottom(), Inkscape::ObjectSet::raiseToTop(), Inkscape::ObjectSet::setClipGroup(), and Inkscape::ObjectSet::topRepr().
bool sp_repr_is_meta_element | ( | const Inkscape::XML::Node * | node | ) |
Determine if the node is a 'title', 'desc' or 'metadata' element.
Definition at line 459 of file repr-util.cpp.
References Inkscape::XML::ELEMENT_NODE, name, Inkscape::XML::Node::name(), node, and Inkscape::XML::Node::type().
Referenced by SPText::_buildLayoutInput(), SPFlowtext::_buildLayoutInput(), sp_item_group_ungroup(), and tidy_operator_inexplicable_spans().
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.
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.
Referenced by insert_hatch_polyfill(), insert_mesh_polyfill(), Inkscape::Extension::PathEffect::processPathEffects(), remove_marker_auto_start_reverse(), and remove_marker_context_paint().
Glib::ustring sp_repr_lookup_content | ( | Inkscape::XML::Node const * | repr, |
gchar const * | name, | ||
Glib::ustring | otherwise | ||
) |
Definition at line 384 of file repr-util.cpp.
References Inkscape::XML::Node::content(), Inkscape::XML::Node::firstChild(), name, node, and sp_repr_lookup_name().
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), and Inkscape::Extension::Template::Template().
Inkscape::XML::Node * sp_repr_lookup_descendant | ( | Inkscape::XML::Node * | repr, |
gchar const * | key, | ||
gchar const * | value | ||
) |
Definition at line 353 of file repr-util.cpp.
References key, and sp_repr_lookup_descendant().
Inkscape::XML::Node const * sp_repr_lookup_descendant | ( | Inkscape::XML::Node const * | repr, |
gchar const * | key, | ||
gchar const * | value | ||
) |
Recursive version of sp_repr_lookup_child().
Definition at line 334 of file repr-util.cpp.
References Inkscape::XML::Node::attribute(), child, Inkscape::XML::Node::firstChild(), key, Inkscape::XML::Node::next(), and sp_repr_lookup_descendant().
Referenced by sp_repr_lookup_descendant(), and sp_repr_lookup_descendant().
Inkscape::XML::Node * sp_repr_lookup_name | ( | Inkscape::XML::Node * | repr, |
gchar const * | name, | ||
gint | maxdepth | ||
) |
Definition at line 394 of file repr-util.cpp.
References name, and sp_repr_lookup_name().
Inkscape::XML::Node const * sp_repr_lookup_name | ( | Inkscape::XML::Node const * | repr, |
gchar const * | name, | ||
gint | maxdepth | ||
) |
Definition at line 361 of file repr-util.cpp.
References child, Inkscape::XML::Node::code(), Inkscape::XML::Node::firstChild(), name, Inkscape::XML::Node::next(), and sp_repr_lookup_name().
Referenced by create_text_with_rectangle(), SPDocument::getReprNamedView(), ink_file_new(), insert_hatch_polyfill(), insert_mesh_polyfill(), SPLPEItem::isOnClipboard(), LivePathEffectObject::setOnClipboard(), sp_import_document(), sp_repr_lookup_content(), sp_repr_lookup_name(), sp_repr_lookup_name(), Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE(), Inkscape::Extension::Template::Template(), and Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile().
std::vector< Inkscape::XML::Node const * > sp_repr_lookup_name_many | ( | Inkscape::XML::Node const * | repr, |
gchar const * | name, | ||
gint | maxdepth | ||
) |
Definition at line 400 of file repr-util.cpp.
References child, Inkscape::XML::Node::code(), Inkscape::XML::Node::firstChild(), name, and sp_repr_lookup_name_many().
Referenced by SPDocument::importDefs(), sp_repr_lookup_name_many(), and Inkscape::Extension::Template::Template().
std::vector< Inkscape::XML::Node * > sp_repr_lookup_property_many | ( | Inkscape::XML::Node * | repr, |
Glib::ustring const & | property, | ||
Glib::ustring const & | value, | ||
int | maxdepth | ||
) |
Definition at line 429 of file repr-util.cpp.
References child, css, Inkscape::XML::Node::firstChild(), sp_repr_css_attr(), sp_repr_css_property(), and sp_repr_lookup_property_many().
Referenced by remove_marker_context_paint(), and sp_repr_lookup_property_many().
|
static |
Definition at line 134 of file repr-util.cpp.
References counter, end, sp_xml_ns_prefix_uri(), and start.
Referenced by sp_xml_ns_uri_prefix().
gchar const * sp_xml_ns_prefix_uri | ( | gchar const * | prefix | ) |
Definition at line 220 of file repr-util.cpp.
References key, namespaces, and sp_xml_ns_register_defaults().
Referenced by sp_xml_ns_auto_prefix().
|
static |
Definition at line 72 of file repr-util.cpp.
References namespaces.
Referenced by sp_xml_ns_prefix_uri(), and sp_xml_ns_uri_prefix().
gchar const * sp_xml_ns_uri_prefix | ( | gchar const * | uri, |
gchar const * | suggested | ||
) |
Definition at line 160 of file repr-util.cpp.
References key, namespaces, sp_xml_ns_auto_prefix(), and sp_xml_ns_register_defaults().
Referenced by sp_repr_qualified_name(), and sp_repr_write_stream_root_element().
|
static |
SPXMLNs.
Definition at line 66 of file repr-util.cpp.
Referenced by sp_xml_ns_prefix_uri(), sp_xml_ns_register_defaults(), and sp_xml_ns_uri_prefix().