summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a603a1)
raw | patch | inline | side by side (parent: 0a603a1)
author | mental <mental@users.sourceforge.net> | |
Fri, 21 Jul 2006 21:28:48 +0000 (21:28 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Fri, 21 Jul 2006 21:28:48 +0000 (21:28 +0000) |
ChangeLog | patch | blob | history | |
src/object-hierarchy.cpp | patch | blob | history | |
src/object-hierarchy.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index fb82617144e84327cc01ef5bdec7b52f22d9579b..23dafb1eab0aabcd087a21ee8aada01de625f8e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2006-07-21 MenTaLguY <mental@rydia.net>
- * src/document-subset.cpp, src/selection.cpp, src/selection.h,
+ * src/document-subset.cpp, src/object-hierarchy.cpp,
+ src/object-hierarchy.h, src/selection.cpp, src/selection.h,
src/ui/view/edit-widget.cpp, src/ui/view/edit-widget.h,
src/uri-references.cpp, src/uri-references.h:
index 658bcb511ea251b5ead33f5b91e6b9f98c5d1b83..49de16d0baf00de0c664a99c7899215c3480bc57 100644 (file)
--- a/src/object-hierarchy.cpp
+++ b/src/object-hierarchy.cpp
#include "sp-object.h"
#include "object-hierarchy.h"
+#include <sigc++/functors/mem_fun.h>
+
namespace Inkscape {
/**
_added_signal.emit(object);
}
-void ObjectHierarchy::_trim_for_release(SPObject *object, ObjectHierarchy *hier)
-{
- hier->_trimBelow(object);
- g_assert(!hier->_hierarchy.empty());
- g_assert(hier->_hierarchy.front().object == object);
+void ObjectHierarchy::_trim_for_release(SPObject *object) {
+ this->_trimBelow(object);
+ g_assert(!this->_hierarchy.empty());
+ g_assert(this->_hierarchy.front().object == object);
sp_object_ref(object, NULL);
- hier->_detach(hier->_hierarchy.front());
- hier->_hierarchy.pop_front();
- hier->_removed_signal.emit(object);
+ this->_detach(this->_hierarchy.front());
+ this->_hierarchy.pop_front();
+ this->_removed_signal.emit(object);
sp_object_unref(object, NULL);
- hier->_changed_signal.emit(hier->top(), hier->bottom());
+ this->_changed_signal.emit(this->top(), this->bottom());
}
ObjectHierarchy::Record ObjectHierarchy::_attach(SPObject *object) {
sp_object_ref(object, NULL);
- gulong id = g_signal_connect(G_OBJECT(object), "release", GCallback(&ObjectHierarchy::_trim_for_release), this);
- return Record(object, id);
+ sigc::connection connection
+ = object->connectRelease(
+ sigc::mem_fun(*this, &ObjectHierarchy::_trim_for_release)
+ );
+ return Record(object, connection);
}
-void ObjectHierarchy::_detach(ObjectHierarchy::Record const &rec) {
- g_signal_handler_disconnect(G_OBJECT(rec.object), rec.handler_id);
+void ObjectHierarchy::_detach(ObjectHierarchy::Record &rec) {
+ rec.connection.disconnect();
sp_object_unref(rec.object, NULL);
}
diff --git a/src/object-hierarchy.h b/src/object-hierarchy.h
index 92da163ea3185103e7f128baa3763d8478af20f7..e5f44b413ea916edc383a57e62ecd6f006ae29d6 100644 (file)
--- a/src/object-hierarchy.h
+++ b/src/object-hierarchy.h
private:
struct Record {
- Record(SPObject *o, gulong id) : object(o), handler_id(id) {}
+ Record(SPObject *o, sigc::connection c)
+ : object(o), connection(c) {}
SPObject *object;
- gulong handler_id;
+ sigc::connection connection;
};
ObjectHierarchy(ObjectHierarchy const &); // no copy
void _trimBelow(SPObject *limit);
Record _attach(SPObject *object);
- void _detach(Record const &record);
+ void _detach(Record &record);
void _clear() { _trimBelow(NULL); }
- static void _trim_for_release(SPObject *released, ObjectHierarchy *hier);
+ void _trim_for_release(SPObject *released);
std::list<Record> _hierarchy;
sigc::signal<void, SPObject *> _added_signal;