diff --git a/src/sp-object.h b/src/sp-object.h
index 767f8b978abb400dc837f675f8eb47fadb55e459..b563d8d3b8abd708a263cde9f92fae961533e9b9 100644 (file)
--- a/src/sp-object.h
+++ b/src/sp-object.h
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<void, SPObject *> slot) {
+ return _release_signal.connect(slot);
+ }
+
/**
* Represents the style properties, whether from presentation attributes, the <tt>style</tt>
* attribute, or inherited.
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. */
}
}
+ /** @brief Check if object is referenced by any other object.
+ */
+ bool isReferenced() { return ( _total_hrefcount > 0 ); }
+
/** @brief Deletes an object.
*
* Detaches the object's repr, and optionally sends notification that the object has been
return _delete_signal.connect(slot);
}
+ sigc::connection connectPositionChanged(sigc::slot<void, SPObject *> slot) {
+ return _position_changed_signal.connect(slot);
+ }
+
/** @brief Returns the object which supercedes this one (if any).
*
* This is mainly useful for ensuring we can correctly perform a series of moves or deletes,
*/
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<void, SPObject *, unsigned int> slot
+ ) {
+ return _modified_signal.connect(slot);
+ }
+
void _sendDeleteSignalRecursive();
void _updateTotalHRefCount(int increment);
}
void _requireSVGVersion(Inkscape::Version version);
+ sigc::signal<void, SPObject *> _release_signal;
sigc::signal<void, SPObject *> _delete_signal;
+ sigc::signal<void, SPObject *> _position_changed_signal;
+ sigc::signal<void, SPObject *, unsigned int> _modified_signal;
SPObject *_successor;
CollectionPolicy _collection_policy;
gchar *_label;
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);