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

SPObject Class Reference

#include <sp-object.h>

Inheritance diagram for SPObject:

Inkscape::ColorProfile SPItem SPStop SPGradient SPLinearGradient SPRadialGradient SPRoot SPOffset SPSpiral

List of all members.

Detailed Description

A refcounting tree node object.

SPObject is an abstract base class of all of the document nodes at the SVG document level. Each SPObject subclass implements a certain SVG element node type, or is an abstract base class for different node types. The SPObject layer is bound to the SPRepr layer, closely following the SPRepr mutations via callbacks. During creation, SPObject parses and interprets all textual attributes and CSS style strings of the SPRepr, and later updates the internal state whenever it receives a signal about a change. The opposite is not true - there are methods manipulating SPObjects directly and such changes do not propagate to the SPRepr layer. This is important for implementation of the undo stack, animations and other features.

SPObjects are bound to the higher-level container SPDocument, which provides document level functionality such as the undo stack, dictionary and so on. Source: doc/architecture.txt

Definition at line 140 of file sp-object.h.

Public Types

enum  Action { ActionGeneral, ActionBBox, ActionUpdate, ActionShow }
< SPObject const,
< SPObject const,
< SPObject,
< SPObject,

Public Member Functions

void _requireSVGVersion (Inkscape::Version version)
void _requireSVGVersion (unsigned major, unsigned minor)
void _sendDeleteSignalRecursive ()
void _updateTotalHRefCount (int increment)
SPObjectappendChildRepr (Inkscape::XML::Node *repr)
GSList * childList (bool add_ref, Action action=ActionGeneral)
 Retrieves children as a GSList.
CollectionPolicy collectionPolicy () const
 Set the policy under which this object will be orphan-collected.
void collectOrphan ()
 Unconditionally delete the object if it is not referenced.
sigc::connection connectDelete (sigc::slot< void, SPObject * > slot)
 Connects a slot to be called when an object is deleted.
sigc::connection connectModified (sigc::slot< void, SPObject *, unsigned int > slot)
 Connects to the modification notification signal.
sigc::connection connectPositionChanged (sigc::slot< void, SPObject * > slot)
sigc::connection connectRelease (sigc::slot< void, SPObject * > slot)
 connects to the release request signal
gchar const * defaultLabel () const
 Returns a default label for this object.
void deleteObject (bool propagate=true)
 Deletes on object.
void deleteObject (bool propagate, bool propagate_descendants)
 Deletes an object.
gchar * desc () const
void emitModified (unsigned int flags)
 Emits a modification notification signal.
SPObject const * firstChild () const
SPObjectfirstChild ()
gchar const * getId () const
SPObjectgetNext ()
SPObjectgetPrev ()
bool hasChildren () const
bool isAncestorOf (SPObject const *object) const
bool isReferenced ()
 Check if object is referenced by any other object.
bool isSiblingOf (SPObject const *object) const
gchar const * label () const
 Gets the author-visible label for this object.
SPObject const * lastChild () const
SPObjectlastChild ()
SPObject const * nearestCommonAncestor (SPObject const *object) const
void releaseReferences ()
 cleans up an SPObject, releasing its references and requesting that references to it be released
void requestDisplayUpdate (unsigned int flags)
 Queues an deferred update of this object's display.
void requestModified (unsigned int flags)
 Requests that a modification notification signal be emitted later (e.g. during the idle loop).
void requestOrphanCollection ()
 Requests a later automatic call to collectOrphan().
void setCollectionPolicy (CollectionPolicy policy)
 Sets the orphan-collection policy in effect for this object.
bool setDesc (gchar const *desc, bool verbatim=false)
void setLabel (gchar const *label)
 Sets the author-visible label for this object.
void setSuccessor (SPObject *successor)
 Indicates that another object supercedes this one.
bool setTitle (gchar const *title, bool verbatim=false)
SPObjectsuccessor ()
 Returns the object which supercedes this one (if any).
gchar * title () const
void updateDisplay (SPCtx *ctx, unsigned int flags)
 Updates the object's display immediately.
Inkscape::XML::NodeupdateRepr (Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
 Updates the given repr based on the object's state.
Inkscape::XML::NodeupdateRepr (unsigned int flags=SP_OBJECT_WRITE_EXT)
 Updates the object's repr based on the object's state.

Public Attributes

CollectionPolicy _collection_policy
gchar * _default_label
sigc::signal< void, SPObject * > _delete_signal
gchar * _label
sigc::signal< void, SPObject
*, unsigned int > 
sigc::signal< void, SPObject * > _position_changed_signal
sigc::signal< void, SPObject * > _release_signal
unsigned int _total_hrefcount
unsigned int cloned: 1
unsigned int hrefcount
unsigned int mflags: 8
unsigned int uflags: 8
SPIXmlSpace xml_space

Private Member Functions

SPObjectfindFirstChild (gchar const *tagname) const
gchar * getTitleOrDesc (gchar const *svg_tagname) const
bool setTitleOrDesc (gchar const *value, gchar const *svg_tagname, bool verbatim)
GString * textualContent () const

Private Attributes

gchar * id


class SPObjectImpl


struct  ParentIteratorStrategy
 Switch containing next() method. More...
struct  SiblingIteratorStrategy
 Switch containing next() method. More...

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

Generated by  Doxygen 1.6.0   Back to index