X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-object.h;h=b563d8d3b8abd708a263cde9f92fae961533e9b9;hb=03a65c733a473cd92d50132961d02c3910417f72;hp=4879e5bea0fe3e7d71c4db7e2ff40f737dd7b79e;hpb=b3f56023dab178fd94e7b5809f9e33bbfada7fc9;p=inkscape.git diff --git a/src/sp-object.h b/src/sp-object.h index 4879e5bea..b563d8d3b 100644 --- a/src/sp-object.h +++ b/src/sp-object.h @@ -158,6 +158,21 @@ struct SPObject : public GObject { Inkscape::XML::Node *repr; /* Our xml representation */ gchar *id; /* Our very own unique id */ + /** @brief cleans up an SPObject, releasing its references and + * requesting that references to it be released + */ + void releaseReferences(); + + /** @brief connects to the release request signal + * + * @param slot the slot to connect + * + * @returns the sigc::connection formed + */ + sigc::connection connectRelease(sigc::slot slot) { + return _release_signal.connect(slot); + } + /** * Represents the style properties, whether from presentation attributes, the style * attribute, or inherited. @@ -206,6 +221,10 @@ struct SPObject : public GObject { SPObject *lastChild() { return _last_child; } SPObject const *lastChild() const { return _last_child; } + enum Action { ActionGeneral, ActionBBox, ActionUpdate, ActionShow }; + /** @brief Retrieves children as a GSList */ + GSList *childList(bool add_ref, Action action = ActionGeneral); + SPObject *appendChildRepr(Inkscape::XML::Node *repr); /** @brief Gets the author-visible label for this object. */ @@ -441,6 +460,18 @@ struct SPObject : public GObject { */ void emitModified(unsigned int flags); + /** @brief Connects to the modification notification signal + * + * @param slot the slot to connect + * + * @returns the connection formed thereby + */ + sigc::connection connectModified( + sigc::slot slot + ) { + return _modified_signal.connect(slot); + } + void _sendDeleteSignalRecursive(); void _updateTotalHRefCount(int increment); @@ -449,8 +480,10 @@ struct SPObject : public GObject { } void _requireSVGVersion(Inkscape::Version version); + sigc::signal _release_signal; sigc::signal _delete_signal; sigc::signal _position_changed_signal; + sigc::signal _modified_signal; SPObject *_successor; CollectionPolicy _collection_policy; gchar *_label; @@ -497,7 +530,6 @@ inline SPObject *sp_object_first_child(SPObject *parent) { SPObject *sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr); void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned); -void sp_object_invoke_release(SPObject *object); void sp_object_set(SPObject *object, unsigned int key, gchar const *value);