Inkscape
Vector Graphics Editor
|
@Inkscape XML tree. More...
Classes | |
class | AttributeRecord |
Key-value pair representing an attribute. More... | |
struct | CommentNode |
Comment node, e.g. More... | |
class | CompositeNodeObserver |
An observer that relays notifications to multiple other observers. More... | |
struct | Document |
Interface for XML documents. More... | |
class | ElementNode |
Element node, e.g. More... | |
class | Event |
Enumeration of all XML event types. More... | |
class | EventAdd |
Object representing child addition. More... | |
class | EventChgAttr |
Object representing attribute change. More... | |
class | EventChgContent |
Object representing content change. More... | |
class | EventChgElementName |
Object representing element name change. More... | |
class | EventChgOrder |
Object representing child order change. More... | |
class | EventDel |
Object representing child removal. More... | |
class | InvalidOperationException |
class | LogBuilder |
Event log builder. More... | |
class | Node |
Interface for refcounted XML nodes. More... | |
class | NodeObserver |
Interface for XML node observers. More... | |
struct | NodeParentIteratorStrategy |
struct | NodeSiblingIteratorStrategy |
struct | PINode |
Processing instruction node, e.g. More... | |
class | SignalObserver |
class | SimpleDocument |
class | SimpleNode |
Default implementation of the XML node stored in memory. More... | |
class | Subtree |
Represents a node and all its descendants. More... | |
struct | TextNode |
Text node, e.g. More... | |
Typedefs | |
typedef Inkscape::Util::ForwardPointerIterator< Node, NodeSiblingIteratorStrategy > | NodeSiblingIterator |
typedef Inkscape::Util::ForwardPointerIterator< Node const, NodeSiblingIteratorStrategy > | NodeConstSiblingIterator |
typedef Inkscape::Util::ForwardPointerIterator< Node, NodeParentIteratorStrategy > | NodeParentIterator |
typedef Inkscape::Util::ForwardPointerIterator< Node const, NodeParentIteratorStrategy > | NodeConstParentIterator |
using | AttributeVector = std::vector< AttributeRecord, Inkscape::GC::Alloc< AttributeRecord > > |
Enumerations | |
enum class | NodeType { DOCUMENT_NODE , ELEMENT_NODE , TEXT_NODE , COMMENT_NODE , PI_NODE } |
Enumeration containing all supported node types. More... | |
Functions | |
static CRXMLNodePtr | get_parent (CRXMLNodePtr n) |
static CRXMLNodePtr | get_first_child (CRXMLNodePtr n) |
static CRXMLNodePtr | get_next (CRXMLNodePtr n) |
static CRXMLNodePtr | get_prev (CRXMLNodePtr cn) |
static char * | get_attr (CRXMLNodePtr n, char const *a) |
static char const * | get_local_name (CRXMLNodePtr n) |
static gboolean | is_element_node (CRXMLNodePtr n) |
void | replay_log_to_observer (Event const *log, NodeObserver &observer) |
void | undo_log_to_observer (Event const *log, NodeObserver &observer) |
bool | id_permitted (Node const *node) |
Node * | previous_node (Node *node) |
Node const * | next_node (Node const *node) |
Node const * | previous_node (Node const *node) |
Node const * | parent_node (Node const *node) |
void | rebase_hrefs (Inkscape::XML::Node *rootxml, gchar const *const old_base, gchar const *const new_base, bool const spns) |
Change relative hrefs in current root XML node (faster than full document generation) More... | |
void | rebase_hrefs (SPDocument *doc, char const *new_base, bool spns) |
Change relative hrefs in doc to be relative to new_base instead of doc.base. More... | |
AttributeVector | rebase_href_attrs (char const *old_abs_base, char const *new_abs_base, const AttributeVector &attributes) |
Change relative xlink:href attributes to be relative to new_abs_base instead of old_abs_base. More... | |
bool | string_equal (const gchar *a, const gchar *b) |
Variables | |
CRNodeIface const | croco_node_iface |
Interface for XML nodes used by libcroco. More... | |
@Inkscape XML tree.
This namespace contains classes and functions that comprise the XML tree of Inkscape documents.
SVG documents in Inkscape are represented as two parallel hierarchies of nodes: the object tree, which contains all information about the document's state when loaded, and the XML tree, which contains all information about the document's XML representation. For this reason this tree is also called the "repr tree", and XML nodes are called "reprs".
The central class is XML::Node, which provides all operations. It should be noted that nodes are currently typeless and operations not valid for their type simply do nothing (like trying to iterate over children of a text node). In addition to standard DOM operations, the XML tree supports observers - objects derived from Xml::NodeObserver which receive notifications about changes in the document tree.
using Inkscape::XML::AttributeVector = typedef std::vector<AttributeRecord, Inkscape::GC::Alloc<AttributeRecord> > |
typedef Inkscape::Util::ForwardPointerIterator<Node const, NodeParentIteratorStrategy> Inkscape::XML::NodeConstParentIterator |
Definition at line 45 of file node-iterators.h.
typedef Inkscape::Util::ForwardPointerIterator<Node const, NodeSiblingIteratorStrategy> Inkscape::XML::NodeConstSiblingIterator |
Definition at line 37 of file node-iterators.h.
typedef Inkscape::Util::ForwardPointerIterator<Node, NodeParentIteratorStrategy> Inkscape::XML::NodeParentIterator |
Definition at line 41 of file node-iterators.h.
typedef Inkscape::Util::ForwardPointerIterator<Node, NodeSiblingIteratorStrategy> Inkscape::XML::NodeSiblingIterator |
Definition at line 33 of file node-iterators.h.
|
strong |
Enumeration containing all supported node types.
Enumerator | |
---|---|
DOCUMENT_NODE | Top-level document node. Do not confuse with the root node. |
ELEMENT_NODE | Regular element node, e.g. <group />. |
TEXT_NODE | Text node, e.g. "Some text" in <group>Some text</group> is represented by a text node. |
COMMENT_NODE | Comment node, e.g. <!– some comment –>. |
PI_NODE | Processing instruction node, e.g. <?xml version="1.0" encoding="utf-8" standalone="no"?>. |
|
static |
Definition at line 47 of file croco-node-iface.cpp.
References Spiro::n.
|
static |
Definition at line 33 of file croco-node-iface.cpp.
References Spiro::n.
Referenced by Inkscape::UI::Widget::Bin::Bin().
|
static |
Definition at line 52 of file croco-node-iface.cpp.
References local_part(), and Spiro::n.
|
static |
Definition at line 34 of file croco-node-iface.cpp.
References Spiro::n.
|
static |
Definition at line 32 of file croco-node-iface.cpp.
References Spiro::n, and parent.
Referenced by Inkscape::UI::Dialog::DialogBase::blink(), Inkscape::UI::Dialog::DialogBase::blink_off(), Inkscape::UI::Dialog::DialogNotebook::close_notebook_callback(), Inkscape::UI::Dialog::BatchItem::on_parent_changed(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_scroll_timeout(), Inkscape::UI::Widget::FillNStroke::performUpdate(), Inkscape::UI::Dialog::BatchItem::set_selected(), Inkscape::UI::Dialog::BatchItem::update_selected(), and Inkscape::UI::Widget::StrokeStyle::updateLine().
|
static |
Definition at line 36 of file croco-node-iface.cpp.
References Spiro::n.
bool Inkscape::XML::id_permitted | ( | Node const * | node | ) |
Definition at line 52 of file node-fns.cpp.
References Inkscape::XML::Node::code(), ELEMENT_NODE, node, and Inkscape::XML::Node::type().
Referenced by SPObject::invoke_build().
|
static |
Definition at line 53 of file croco-node-iface.cpp.
References ELEMENT_NODE, and Spiro::n.
Definition at line 34 of file node-fns.h.
References Inkscape::XML::Node::next(), and node.
Referenced by Inkscape::UI::PathManipulator::_bsplineHandlePosition(), and Inkscape::UI::PathManipulator::_bsplineHandleReposition().
Definition at line 66 of file node-fns.h.
References node, and Inkscape::XML::Node::parent().
Definition at line 69 of file node-fns.cpp.
Referenced by Inkscape::UI::PathManipulator::_createControlPointsFromGeometry(), and previous_node().
Definition at line 51 of file node-fns.h.
References node, and previous_node().
AttributeVector Inkscape::XML::rebase_href_attrs | ( | char const * | old_abs_base, |
char const * | new_abs_base, | ||
const AttributeVector & | attributes | ||
) |
Change relative xlink:href attributes to be relative to new_abs_base instead of old_abs_base.
Note that old_abs_base and new_abs_base must each be non-NULL, absolute directory paths.
Referenced by sp_repr_write_stream_element().
void Inkscape::XML::rebase_hrefs | ( | Inkscape::XML::Node * | rootxml, |
gchar const *const | old_base, | ||
gchar const *const | new_base, | ||
bool const | spns | ||
) |
Change relative hrefs in current root XML node (faster than full document generation)
to be relative to new_base instead of doc.base.
(NULL doc base or new_base is interpreted as current working directory.)
spns | True if doc should contain sodipodi:absref attributes. |
Definition at line 159 of file rebase-hrefs.cpp.
References Inkscape::XML::Node::name(), Inkscape::XML::Node::sp_repr_visit_descendants(), and Inkscape::URI::str().
Referenced by SPDocument::do_change_filename(), and file_import().
void Inkscape::XML::rebase_hrefs | ( | SPDocument * | doc, |
char const * | new_base, | ||
bool | spns | ||
) |
Change relative hrefs in doc to be relative to new_base instead of doc.base.
(NULL doc base or new_base is interpreted as current working directory.)
spns | True if doc should contain sodipodi:absref attributes. |
void Inkscape::XML::replay_log_to_observer | ( | Event const * | log, |
NodeObserver & | observer | ||
) |
Definition at line 190 of file event.cpp.
References log(), and observer.
Referenced by sp_repr_debug_print_log(), and sp_repr_replay_log().
bool Inkscape::XML::string_equal | ( | const gchar * | a, |
const gchar * | b | ||
) |
Definition at line 649 of file simple-node.cpp.
Referenced by Inkscape::XML::SimpleNode::equal().
void Inkscape::XML::undo_log_to_observer | ( | Event const * | log, |
NodeObserver & | observer | ||
) |
Definition at line 128 of file event.cpp.
References log(), and observer.
Referenced by sp_repr_undo_log().
CRNodeIface const Inkscape::XML::croco_node_iface |
Interface for XML nodes used by libcroco.
This structure defines operations on Inkscape::XML::Node used by the libcroco CSS parsing library.
Definition at line 62 of file croco-node-iface.cpp.
Referenced by SPDocument::getObjectsBySelector(), and sp_repr_sel_eng().