diff src/gtknotify.c @ 12242:976677e67239

[gaim-migrate @ 14544] Rework the notify API close callbacks. They are now called by the core, instead of the UI. Prior to a couple days ago, they weren't actually implemented in the UI at all. As a side note, if anyone knows why gpointer is declared as a T_GaimObj instead of a T_PTR, please let me know. That seems wrong, especially since void * is a T_PTR and gconstpointer is a T_PTR. This may or may not cause problems for the notify change (void * -> gpointer) to user_data. NOTE: I did not change this, even though I think it's wrong. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 28 Nov 2005 01:50:56 +0000
parents b4391f2ae8de
children ca27de274225
line wrap: on
line diff
--- a/src/gtknotify.c	Mon Nov 28 01:43:53 2005 +0000
+++ b/src/gtknotify.c	Mon Nov 28 01:50:56 2005 +0000
@@ -53,9 +53,6 @@
 	GtkListStore *model;
 	GtkWidget *treeview;
 	GtkWidget *window;
-	GHookFunc close_cb;
-	gpointer close_cb_data;
-
 } GaimNotifySearchResultsData;
 
 typedef struct
@@ -68,8 +65,7 @@
 static void *gaim_gtk_notify_emails(size_t count, gboolean detailed,
 									const char **subjects,
 									const char **froms, const char **tos,
-									const char **urls, GHookFunc cb,
-									gpointer user_data);
+									const char **urls);
 
 static void
 message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget)
@@ -129,8 +125,7 @@
 
 static void *
 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title,
-						const char *primary, const char *secondary,
-						GHookFunc cb, gpointer user_data)
+						const char *primary, const char *secondary)
 {
 	GtkWidget *dialog;
 	GtkWidget *hbox;
@@ -208,22 +203,19 @@
 
 static void *
 gaim_gtk_notify_email(const char *subject, const char *from,
-					  const char *to, const char *url,
-					  GHookFunc cb, gpointer user_data)
+					  const char *to, const char *url)
 {
 	return gaim_gtk_notify_emails(1, TRUE,
 								  (subject == NULL ? NULL : &subject),
 								  (from    == NULL ? NULL : &from),
 								  (to      == NULL ? NULL : &to),
-								  (url     == NULL ? NULL : &url),
-								  cb, user_data);
+								  (url     == NULL ? NULL : &url));
 }
 
 static void *
 gaim_gtk_notify_emails(size_t count, gboolean detailed,
 					   const char **subjects, const char **froms,
-					   const char **tos, const char **urls,
-					   GHookFunc cb, gpointer user_data)
+					   const char **tos, const char **urls)
 {
 	GaimNotifyMailData *data;
 	GtkWidget *dialog;
@@ -354,8 +346,7 @@
 
 static void *
 gaim_gtk_notify_formatted(const char *title, const char *primary,
-						  const char *secondary, const char *text,
-						  GHookFunc cb, gpointer user_data)
+						  const char *secondary, const char *text)
 {
 	GtkWidget *window;
 	GtkWidget *vbox;
@@ -478,8 +469,7 @@
 static void *
 gaim_gtk_notify_searchresults(GaimConnection *gc, const char *title,
 							  const char *primary, const char *secondary,
-							  GaimNotifySearchResults *results, GHookFunc cb,
-							  gpointer user_data)
+							  GaimNotifySearchResults *results)
 {
 	GtkWidget *window;
 	GtkWidget *treeview;
@@ -614,8 +604,6 @@
 	data->model = model;
 	data->treeview = treeview;
 	data->window = window;
-	data->close_cb = cb;
-	data->close_cb_data = user_data;
 
 	/* Insert rows. */
 	gaim_gtk_notify_searchresults_new_rows(gc, results, data, NULL);
@@ -639,15 +627,13 @@
 
 static void *
 gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who,
-						 const char *text,
-						 GHookFunc cb, gpointer user_data)
+						 const char *text)
 {
 	char *primary;
 	void *ui_handle;
 
 	primary = g_strdup_printf(_("Info for %s"), who);
-	ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL,
-									  text, cb, user_data);
+	ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text);
 	g_free(primary);
 	return ui_handle;
 }
@@ -670,9 +656,6 @@
 
 		gtk_widget_destroy(data->window);
 
-		if (data->close_cb != NULL)
-			data->close_cb(data->close_cb_data);
-
 		g_free(data);
 	}
 	else if (ui_handle != NULL)