changeset 5476:9bcd8cd625ae

[gaim-migrate @ 5872] Some little tidy-ups. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 22 May 2003 05:23:14 +0000
parents ad9887c91a59
children e8e498255369
files src/gtknotify.c src/notify.c src/notify.h
diffstat 3 files changed, 34 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtknotify.c	Thu May 22 01:31:56 2003 +0000
+++ b/src/gtknotify.c	Thu May 22 05:23:14 2003 +0000
@@ -24,6 +24,11 @@
 #include "stock.h"
 #include <gtk/gtk.h>
 
+static void *gaim_gtk_notify_emails(size_t count, const char **subjects,
+									const char **froms, const char **tos,
+									const char **urls, GCallback cb,
+									void *user_data);
+
 static void *
 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title,
 						const char *primary, const char *secondary,
@@ -98,7 +103,7 @@
 					  const char *to, const char *url,
 					  GCallback cb, void *user_data)
 {
-	return NULL;
+	return gaim_gtk_notify_emails(1, &subject, &from, &to, &url, cb, user_data);
 }
 
 static void *
--- a/src/notify.c	Thu May 22 01:31:56 2003 +0000
+++ b/src/notify.c	Thu May 22 05:23:14 2003 +0000
@@ -29,7 +29,7 @@
 {
 	GaimNotifyType type;
 	void *handle;
-	void *ptr;
+	void *ui_handle;
 
 } GaimNotifyInfo;
 
@@ -47,15 +47,15 @@
 	if (ops != NULL && ops->notify_message != NULL) {
 		GaimNotifyInfo *info;
 
-		info         = g_new0(GaimNotifyInfo, 1);
-		info->type   = GAIM_NOTIFY_MESSAGE;
-		info->handle = handle;
-		info->ptr    = ops->notify_message(type, title, primary, secondary,
-										   cb, user_data);
+		info            = g_new0(GaimNotifyInfo, 1);
+		info->type      = GAIM_NOTIFY_MESSAGE;
+		info->handle    = handle;
+		info->ui_handle = ops->notify_message(type, title, primary,
+											  secondary, cb, user_data);
 
 		handles = g_list_append(handles, info);
 
-		return info->ptr;
+		return info->ui_handle;
 	}
 
 	return NULL;
@@ -73,15 +73,15 @@
 	if (ops != NULL && ops->notify_email != NULL) {
 		GaimNotifyInfo *info;
 
-		info         = g_new0(GaimNotifyInfo, 1);
-		info->type   = GAIM_NOTIFY_EMAIL;
-		info->handle = handle;
-		info->ptr    = ops->notify_email(subject, from, to, url, cb,
-										 user_data);
+		info            = g_new0(GaimNotifyInfo, 1);
+		info->type      = GAIM_NOTIFY_EMAIL;
+		info->handle    = handle;
+		info->ui_handle = ops->notify_email(subject, from, to, url, cb,
+											user_data);
 
 		handles = g_list_append(handles, info);
 
-		return info->ptr;
+		return info->ui_handle;
 	}
 
 	return NULL;
@@ -101,38 +101,38 @@
 	if (ops != NULL && ops->notify_emails != NULL) {
 		GaimNotifyInfo *info;
 
-		info         = g_new0(GaimNotifyInfo, 1);
-		info->type   = GAIM_NOTIFY_EMAILS;
-		info->handle = handle;
-		info->ptr    = ops->notify_emails(count, subjects, froms, tos, urls,
-										  cb, user_data);
+		info            = g_new0(GaimNotifyInfo, 1);
+		info->type      = GAIM_NOTIFY_EMAILS;
+		info->handle    = handle;
+		info->ui_handle = ops->notify_emails(count, subjects, froms, tos,
+											 urls, cb, user_data);
 
 		handles = g_list_append(handles, info);
 
-		return info->ptr;
+		return info->ui_handle;
 	}
 
 	return NULL;
 }
 
 void
-gaim_notify_close(GaimNotifyType type, void *ptr)
+gaim_notify_close(GaimNotifyType type, void *ui_handle)
 {
 	GList *l;
 	GaimNotifyUiOps *ops;
 
-	g_return_if_fail(ptr != NULL);
+	g_return_if_fail(ui_handle != NULL);
 
 	ops = gaim_get_notify_ui_ops();
 
 	for (l = handles; l != NULL; l = l->next) {
 		GaimNotifyInfo *info = l->data;
 
-		if (info->ptr == ptr) {
+		if (info->ui_handle == ui_handle) {
 			handles = g_list_remove(handles, info);
 
 			if (ops != NULL && ops->close_notify != NULL)
-				ops->close_notify(info->type, ptr);
+				ops->close_notify(info->type, ui_handle);
 
 			g_free(info);
 
@@ -160,7 +160,7 @@
 			handles = g_list_remove(handles, info);
 
 			if (ops != NULL && ops->close_notify != NULL)
-				ops->close_notify(info->type, info->ptr);
+				ops->close_notify(info->type, info->ui_handle);
 
 			g_free(info);
 		}
--- a/src/notify.h	Thu May 22 01:31:56 2003 +0000
+++ b/src/notify.h	Thu May 22 05:23:14 2003 +0000
@@ -65,7 +65,7 @@
 						   const char **urls, GCallback cb,
 						   void *user_data);
 
-	void (*close_notify)(GaimNotifyType type, void *uihandle);
+	void (*close_notify)(GaimNotifyType type, void *ui_handle);
 
 } GaimNotifyUiOps;
 
@@ -138,10 +138,10 @@
  * This should be used only by the UI operation functions and part of the
  * core.
  *
- * @param type     The notification type.
- * @param uihandle The notification UI handle.
+ * @param type      The notification type.
+ * @param ui_handle The notification UI handle.
  */
-void gaim_notify_close(GaimNotifyType type, void *uihandle);
+void gaim_notify_close(GaimNotifyType type, void *ui_handle);
 
 /**
  * Closes all notifications registered with the specified handle.