From: mental Date: Sat, 29 Jul 2006 22:21:36 +0000 (+0000) Subject: remove GObject signals from SPObject X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0acfc8cf31a9b07c5e8fd06479b60a1c066f715f;p=inkscape.git remove GObject signals from SPObject --- diff --git a/ChangeLog b/ChangeLog index 056d54fc4..f62d5305b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-06-29 MenTaLguY + * src/sp-object.cpp: + + remove GObject signals from SPObject + * src/desktop.cpp, src/desktop.h, src/sp-gradient.cpp, src/sp-gradient.h, src/sp-pattern.cpp, src/sp-pattern.h, src/sp-switch.cpp, src/sp-switch.h, src/widgets/desktop-widget.cpp, diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 43611e9ed..62a442d0a 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -99,8 +99,6 @@ static gchar *sp_object_get_unique_id(SPObject *object, gchar const *defid); guint update_in_progress = 0; // guard against update-during-update -enum {RELEASE, MODIFIED, LAST_SIGNAL}; - Inkscape::XML::NodeEventVector object_event_vector = { sp_object_repr_child_added, sp_object_repr_child_removed, @@ -110,7 +108,6 @@ Inkscape::XML::NodeEventVector object_event_vector = { }; static GObjectClass *parent_class; -static guint object_signals[LAST_SIGNAL] = {0}; /** * Registers the SPObject class with Gdk and returns its type number. @@ -147,21 +144,6 @@ sp_object_class_init(SPObjectClass *klass) parent_class = (GObjectClass *) g_type_class_ref(G_TYPE_OBJECT); - object_signals[RELEASE] = g_signal_new("release", - G_TYPE_FROM_CLASS(klass), - (GSignalFlags)(G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS), - G_STRUCT_OFFSET(SPObjectClass, release), - NULL, NULL, - sp_marshal_VOID__VOID, - G_TYPE_NONE, 0); - object_signals[MODIFIED] = g_signal_new("modified", - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(SPObjectClass, modified), - NULL, NULL, - sp_marshal_NONE__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - object_class->finalize = sp_object_finalize; klass->child_added = sp_object_child_added; @@ -869,7 +851,10 @@ void SPObject::releaseReferences() { sp_repr_remove_listener_by_data(this->repr, this); - g_signal_emit(G_OBJECT(this), object_signals[RELEASE], 0); + SPObjectClass *klass=(SPObjectClass *)G_OBJECT_GET_CLASS(this); + if (klass->release) { + klass->release(this); + } this->_release_signal.emit(this); /* all hrefs should be released by the "release" handlers */ @@ -1302,7 +1287,10 @@ SPObject::emitModified(unsigned int flags) this->mflags = 0; g_object_ref(G_OBJECT(this)); - g_signal_emit(G_OBJECT(this), object_signals[MODIFIED], 0, flags); + SPObjectClass *klass=(SPObjectClass *)G_OBJECT_GET_CLASS(this); + if (klass->modified) { + klass->modified(this, flags); + } _modified_signal.emit(this, flags); g_object_unref(G_OBJECT(this)); }