changeset 1874:1e33bd2d7780

[gaim-migrate @ 1884] hm. i'm still not sure i like this. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 22 May 2001 00:02:33 +0000
parents 08ac51210d09
children c0a69f90d662
files src/buddy.c src/gaim.h src/plugins.c
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Mon May 21 23:14:41 2001 +0000
+++ b/src/buddy.c	Tue May 22 00:02:33 2001 +0000
@@ -697,7 +697,10 @@
 			if (g->prpl->buddy_menu)
 				(*g->prpl->buddy_menu)(menu, g, b->name);
 		}
-		
+
+		/* we send the menu widget so we can add menuitems within a plugin */
+		plugin_event (event_draw_menu, menu, b->name, 0, 0);
+	
 		gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
 			       event->button, event->time);
 
--- a/src/gaim.h	Mon May 21 23:14:41 2001 +0000
+++ b/src/gaim.h	Tue May 22 00:02:33 2001 +0000
@@ -198,6 +198,7 @@
 	event_quit,
 	event_new_conversation,
 	event_set_info,
+	event_draw_menu,
 	/* any others? it's easy to add... */
 };
 
--- a/src/plugins.c	Mon May 21 23:14:41 2001 +0000
+++ b/src/plugins.c	Tue May 22 00:02:33 2001 +0000
@@ -625,6 +625,9 @@
 	case event_set_info:
 		sprintf(buf, "event_set_info");
 		break;
+	case event_draw_menu:
+		sprintf(buf, "event_draw_menu");
+		break;
 	default:
 		sprintf(buf, "event_unknown");
 		break;
@@ -748,6 +751,13 @@
 					(*function)((int)arg1, g->data);
 				}
 				break;
+			/* GtkWidget *, char * */
+			case event_draw_menu:
+				{
+					void(*function)(GtkWidget *, char *) = g->function;
+					(*function)(arg1, arg2);
+				}
+				break;
 
 			default:
 				debug_printf("unknown event %d\n", event);
@@ -843,6 +853,9 @@
 	case event_new_conversation:
 		g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1);
 		break;
+	case event_draw_menu:
+		g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
+		break;
 	default:
 		break;
 	}