From 7843d8b478be7bd9157108c7fead199d146a588b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 8 Jun 2006 00:17:00 +0000 Subject: [PATCH] Add a destroy notify for the callback data. (#344209, Murray Cumming) 2006-06-07 Matthias Clasen * gtk/gtknotebook.h: * gtk/gtknotebook.c (gtk_notebook_set_window_creation_hook): Add a destroy notify for the callback data. (#344209, Murray Cumming) --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ gtk/gtknotebook.c | 13 ++++++++++--- gtk/gtknotebook.h | 3 ++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f0c5071d5..643faada31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-07 Matthias Clasen + + * gtk/gtknotebook.h: + * gtk/gtknotebook.c (gtk_notebook_set_window_creation_hook): + Add a destroy notify for the callback data. (#344209, + Murray Cumming) + 2006-06-07 Jürg Billeter * gtk/Makefile.am: Fix building gtkbuiltincache.h without system GTK+. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1f0c5071d5..643faada31 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2006-06-07 Matthias Clasen + + * gtk/gtknotebook.h: + * gtk/gtknotebook.c (gtk_notebook_set_window_creation_hook): + Add a destroy notify for the callback data. (#344209, + Murray Cumming) + 2006-06-07 Jürg Billeter * gtk/Makefile.am: Fix building gtkbuiltincache.h without system GTK+. diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 9f4d7cd283..2e02cbb774 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -397,6 +397,7 @@ static void stop_scrolling (GtkNotebook *notebook); static GtkNotebookWindowCreationFunc window_creation_hook = NULL; static gpointer window_creation_hook_data; +static GDestroyNotify window_creation_hook_destroy = NULL; static guint notebook_signals[LAST_SIGNAL] = { 0 }; @@ -7142,8 +7143,9 @@ gtk_notebook_reorder_child (GtkNotebook *notebook, /** * gtk_notebook_set_window_creation_hook: - * @func: the #GtkNotebookWindowCreationFunc, or NULL - * @data: user data for @func. + * @func: the #GtkNotebookWindowCreationFunc, or %NULL + * @data: user data for @func + * @destroy: Destroy notifier for @data, or %NULL * * Installs a global function used to create a window * when a detached tab is dropped in an empty area. @@ -7152,10 +7154,15 @@ gtk_notebook_reorder_child (GtkNotebook *notebook, **/ void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func, - gpointer data) + gpointer data, + GDestroyNotify destroy) { + if (window_creation_hook_destroy) + window_creation_hook_destroy (window_creation_hook_data); + window_creation_hook = func; window_creation_hook_data = data; + window_creation_hook_destroy = destroy; } /** diff --git a/gtk/gtknotebook.h b/gtk/gtknotebook.h index b60efe55da..3c9c45eeb9 100644 --- a/gtk/gtknotebook.h +++ b/gtk/gtknotebook.h @@ -163,7 +163,8 @@ void gtk_notebook_remove_page (GtkNotebook *notebook, ***********************************************************/ void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func, - gpointer data); + gpointer data, + GDestroyNotify destroy); void gtk_notebook_set_group_id (GtkNotebook *notebook, gint group_id); gint gtk_notebook_get_group_id (GtkNotebook *notebook);