summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40e2934)
raw | patch | inline | side by side (parent: 40e2934)
author | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 21:06:37 +0000 (21:06 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 21:06:37 +0000 (21:06 +0000) |
ChangeLog | patch | blob | history | |
src/sp-gradient.cpp | patch | blob | history | |
src/sp-gradient.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index c4869d4feb029c2635833dfd36650ea82e7c8fc0..9cb88be4f034ac5ad122a93a67bef581cdf1d9c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2006-06-29 MenTaLguY <mental@rydia.net>
- * src/desktop.cpp, src/desktop.h, src/widgets/desktop-widget.cpp,
+ * src/desktop.cpp, src/desktop.h, src/sp-gradient.cpp,
+ src/sp-gradient.cpp, src/widgets/desktop-widget.cpp,
src/widgets/desktop-widget.h, src/widgets/gradient-image.cpp,
src/widgets/gradient-image.h, src/widgets/gradient-toolbar.cpp,
src/widgets/gradient-toolbar.cpp:
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index dd7b7b257aa6659a0fe50616b896d529c3107007..2e6d2a37c303b746b860850942b82ad726f15aec 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
#include <libnr/nr-matrix-translate-ops.h>
#include "libnr/nr-scale-translate-ops.h"
+#include <sigc++/functors/ptr_fun.h>
+#include <sigc++/adaptors/bind.h>
#include "display/nr-gradient-gpl.h"
#include "svg/svg.h"
gr->vector.stops.clear();
gr->color = NULL;
+
+ new (&gr->modified_connection) sigc::connection();
}
/**
}
if (gradient->ref) {
- if (gradient->ref->getObject()) {
- sp_signal_disconnect_by_data(gradient->ref->getObject(), gradient);
- }
+ gradient->modified_connection.disconnect();
gradient->ref->detach();
delete gradient->ref;
gradient->ref = NULL;
gradient->color = NULL;
}
+ gradient->modified_connection.~connection();
+
if (((SPObjectClass *) gradient_parent_class)->release)
((SPObjectClass *) gradient_parent_class)->release(object);
}
gradient_ref_changed(SPObject *old_ref, SPObject *ref, SPGradient *gr)
{
if (old_ref) {
- sp_signal_disconnect_by_data(old_ref, gr);
+ gr->modified_connection.disconnect();
}
if ( SP_IS_GRADIENT(ref)
&& ref != gr )
{
- g_signal_connect(G_OBJECT(ref), "modified", G_CALLBACK(gradient_ref_modified), gr);
+ gr->modified_connection = ref->connectModified(sigc::bind<2>(sigc::ptr_fun(&gradient_ref_modified), gr));
}
/// \todo Fixme: what should the flags (second) argument be? */
gradient_ref_modified(ref, 0, gr);
diff --git a/src/sp-gradient.h b/src/sp-gradient.h
index 9c152598b3a033063dbac03591e7def38f0ee866..b0ed49c0023d8205c8c6202da7870899eda718cb 100644 (file)
--- a/src/sp-gradient.h
+++ b/src/sp-gradient.h
#include "sp-gradient-units.h"
#include "sp-gradient-vector.h"
+#include <sigc++/connection.h>
+
struct SPGradientReference;
typedef enum {
SPGradientVector vector;
/** Rendered color array (4 * 1024 bytes) */
guchar *color;
+
+ sigc::connection modified_connection;
};
/**