Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Inkscape::XML::Node Class Reference

#include <repr.h>

Inheritance diagram for Inkscape::XML::Node:


List of all members.

Detailed Description

NB! Unless explicitly stated all methods are noref/nostrcpy
Though Inkscape::XML::Node provides "signals" for notification when individual nodes change, there is no mechanism to receive notification for overall document changes. However, with the addition of the transactions code, it would not be very hard to implement if you wanted it.
Inkscape::XML::Node itself doesn't use GObject signals at present -- Inkscape::XML::Nodes maintain lists of Inkscape::XML::NodeEventVectors (added via sp_repr_add_listener), which are used to specify callbacks when something changes.
Here are the current callbacks in an event vector (they may be NULL):

void (* child_added)(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void *data); Called once a child has been added.

void (* child_removed)(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void *data); Called after a child is removed; ref is the child that used to precede the removed child.

void (* attr_changed)(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, void *data); Called after an attribute has been changed.

void (* content_changed)(Inkscape::XML::Node *repr, gchar const *oldcontent, gchar const *newcontent, void *data); Called after an element's content has been changed.

void (* order_changed)(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *oldref, Inkscape::XML::Node *newref, void *data); Called once the child has been moved to its new position in the child order.

Inkscape::XML::Node mini-FAQ

Since I'm not very familiar with this section of code but I need to use it heavily for the RDF work, I'm going to answer various questions I run into with my best-guess answers so others can follow along too.


(but it's better to arrange for your caller to pass in the relevent document rather than assuming it's necessarily the active one and using SP_ACTIVE_DOCUMENT)

Kees Cook 2004-07-01, updated MenTaLguY 2005-01-25

Definition at line 39 of file node.h.

Public Member Functions

unsigned _anchored_refcount () const
virtual void _bindDocument (Document &document)=0
virtual unsigned _cachedPosition () const =0
virtual unsigned _childPosition (Node const &child) const =0
virtual void _setCachedPosition (unsigned position) const =0
virtual void _setNext (Node *next)=0
virtual void _setParent (Node *parent)=0
virtual NodeObserver & _subtreeObservers ()=0
virtual void addChild (Node *child, Node *ref)=0
virtual void addListener (NodeEventVector const *vector, void *data)=0
virtual void addObserver (NodeObserver &observer)=0
virtual void addSubtreeObserver (NodeObserver &observer)=0
void anchor () const
virtual void appendChild (Node *child)=0
virtual gchar const * attribute (gchar const *key) const =0
virtual Inkscape::Util::List
< AttributeRecord const > 
attributeList () const =0
virtual void changeOrder (Node *child, Node *ref)=0
virtual unsigned childCount () const =0
virtual int code () const =0
virtual gchar const * content () const =0
virtual Document const * document () const =0
virtual Document * document ()=0
virtual Nodeduplicate (Document *doc) const =0
virtual Node const * firstChild () const =0
virtual NodefirstChild ()=0
virtual Node const * lastChild () const =0
virtual NodelastChild ()=0
virtual bool matchAttributeName (gchar const *partial_name) const =0
virtual void mergeFrom (Node const *src, gchar const *key)=0
virtual gchar const * name () const =0
virtual Node const * next () const =0
virtual Nodenext ()=0
virtual Node const * nthChild (unsigned index) const =0
virtual NodenthChild (unsigned index)=0
virtual Node const * parent () const =0
virtual Nodeparent ()=0
virtual unsigned position () const =0
void release () const
virtual void removeChild (Node *child)=0
virtual void removeListenerByData (void *data)=0
virtual void removeObserver (NodeObserver &observer)=0
virtual void removeSubtreeObserver (NodeObserver &observer)=0
virtual Node const * root () const =0
virtual Noderoot ()=0
virtual void setAttribute (gchar const *key, gchar const *value, bool is_interactive=false)=0
virtual void setCodeUnsafe (int code)=0
virtual void setContent (gchar const *value)=0
virtual void setPosition (int pos)=0
virtual void synthesizeEvents (NodeObserver &observer)=0
virtual void synthesizeEvents (NodeEventVector const *vector, void *data)=0
virtual NodeType type () const =0

Protected Member Functions

 Node (Node const &)

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

Generated by  Doxygen 1.6.0   Back to index