summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a8f1a69)
raw | patch | inline | side by side (parent: a8f1a69)
author | mental <mental@users.sourceforge.net> | |
Sun, 5 Mar 2006 21:53:38 +0000 (21:53 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 5 Mar 2006 21:53:38 +0000 (21:53 +0000) |
ChangeLog | patch | blob | history | |
src/sp-object.cpp | patch | blob | history | |
src/sp-object.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 622e817e536072dc8d39362ea12008be943099c9..8edea42d5febc60a1512d8bf2b8f106a00477e18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-03-05 MenTaLguY <mental@rydia.net>
+
+ * src/sp-object.h, src/sp-object.cpp:
+
+ Add signal for notification of object position changes.
+
2006-03-05 MenTaLguY <mental@rydia.net>
* src/Makefile_insert, src/document-subset.cpp, src/document-subset.h:
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 4a1a2e09ed84a6a28825af91485be617cbaec2a9..fd368dd613a0164915c70f0797dec0bb09f10f08 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
object->_collection_policy = SPObject::COLLECT_WITH_PARENT;
new (&object->_delete_signal) sigc::signal<void, SPObject *>();
+ new (&object->_position_changed_signal) sigc::signal<void, SPObject *>();
object->_successor = NULL;
object->_label = NULL;
}
spobject->_delete_signal.~signal();
+ spobject->_position_changed_signal.~signal();
}
namespace {
@@ -771,6 +773,7 @@ static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child
g_return_if_fail(ochild != NULL);
SPObject *prev = new_ref ? sp_object_get_child_by_repr(object, new_ref) : NULL;
sp_object_reorder(ochild, prev);
+ ochild->_position_changed_signal.emit(ochild);
}
/**
diff --git a/src/sp-object.h b/src/sp-object.h
index 767f8b978abb400dc837f675f8eb47fadb55e459..e853de097907055d0623422677b10fb8de7212d1 100644 (file)
--- a/src/sp-object.h
+++ b/src/sp-object.h
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 _requireSVGVersion(Inkscape::Version version);
sigc::signal<void, SPObject *> _delete_signal;
+ sigc::signal<void, SPObject *> _position_changed_signal;
SPObject *_successor;
CollectionPolicy _collection_policy;
gchar *_label;