From be7df18d6aef42dd657426b6a9d30834e5f54ca6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 28 Aug 2011 21:18:21 +0200 Subject: Remove nr-object.h and nr-macros.h (bzr r10582.1.10) --- src/widgets/toolbox.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 61c7c8e88..7edc24420 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -863,23 +863,6 @@ static void trigger_sp_action( GtkAction* /*act*/, gpointer user_data ) } } -static void sp_action_action_set_sensitive(SPAction * /*action*/, unsigned int sensitive, void *data) -{ - if ( data ) { - GtkAction* act = GTK_ACTION(data); - gtk_action_set_sensitive( act, sensitive ); - } -} - -static SPActionEventVector action_event_vector = { - {NULL}, - NULL, - NULL, - sp_action_action_set_sensitive, - NULL, - NULL -}; - static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size ) { GtkAction* act = 0; @@ -891,8 +874,13 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi g_signal_connect( G_OBJECT(inky), "activate", G_CALLBACK(trigger_sp_action), targetAction ); - SPAction*rebound = dynamic_cast( nr_object_ref( dynamic_cast(targetAction) ) ); - nr_active_object_add_listener( (NRActiveObject *)rebound, (NRObjectEventVector *)&action_event_vector, sizeof(SPActionEventVector), inky ); + // FIXME: memory leak: this is not unrefed anywhere + g_object_ref(G_OBJECT(targetAction)); + g_object_set_data_full(G_OBJECT(inky), "SPAction", (void*) targetAction, (GDestroyNotify) &g_object_unref); + targetAction->signal_set_sensitive.connect( + sigc::bind<0>( + sigc::ptr_fun(>k_action_set_sensitive), + GTK_ACTION(inky))); return act; } -- cgit v1.2.3