changeset 579:7b501c39a6ee

[gaim-migrate @ 589] perl.c is starting to get finalized. also, made the smiley dialog a little prettier, and a bit less code. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 02 Aug 2000 04:53:00 +0000
parents a0636d0d9ee2
children 9a8b067eb368
files src/dialogs.c src/perl.c
diffstat 2 files changed, 168 insertions(+), 210 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Wed Aug 02 02:28:45 2000 +0000
+++ b/src/dialogs.c	Wed Aug 02 04:53:00 2000 +0000
@@ -3584,28 +3584,51 @@
 		
 	return;
 }
+
+static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win, int face)
+{
+	GtkWidget *tpm;
+	GdkBitmap *mask;
+	GdkPixmap *dpm;
+	GtkWidget *button;
+
+	dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm);
+	tpm = gtk_pixmap_new(dpm, mask);
+	gtk_widget_show(tpm);
+	button = gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL, NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face);
+	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
+
+	if (display_options & OPT_DISP_COOL_LOOK)
+		gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+}
 	
 void show_smiley_dialog(struct conversation *c, GtkWidget *widget)
 {
 	GtkWidget *dialog;
 	GtkWidget *cancel_button, *cancel_label;
-	GtkWidget *vbox, *smiley_box_1, *smiley_box_2, *cancel_button_box;
-	GdkPixmap *angel_i, *bigsmile_i, *burp_i, *crossedlips_i, *cry_i, *embarrassed_i, *kiss_i, *moneymouth_i, *sad_i, *scream_i, *smile_i, *smile8_i, *think_i, *tongue_i, *wink_i, *yell_i, *cancel_i;
-	GtkWidget *angel_p, *bigsmile_p, *burp_p, *crossedlips_p, *cry_p, *embarrassed_p, *kiss_p, *moneymouth_p, *sad_p, *scream_p, *smile_p, *smile8_p, *think_p, *tongue_p, *wink_p, *yell_p, *cancel_p;
-	GtkWidget *angel, *bigsmile, *burp, *crossedlips, *cry, *embarrassed, *kiss, *moneymouth, *sad, *scream, *smile, *smile8, *think, *tongue, *wink, *yell;
+	GtkWidget *vbox, *smiley_box_1, *smiley_box_2, *smiley_box_3, *smiley_box_4, *cancel_button_box;
+	GdkPixmap *cancel_i;
+	GtkWidget *cancel_p;
 	GdkBitmap *mask;
 	GtkWidget *win;
+	GtkWidget *frame;
 
 	if (c->smiley_dialog)
 		return;
+
+	win = c->window;
 		
-	dialog = gtk_dialog_new();
-	win = c->window;
+	dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+	gtk_window_set_policy(GTK_WINDOW(dialog), 0, 0, 1);
+
+	frame = gtk_frame_new(_("Smile!"));
 	
 	/* setup boxes */
 	vbox = gtk_vbox_new(TRUE, 0);
 	smiley_box_1 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
 	smiley_box_2 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
+	smiley_box_3 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
+	smiley_box_4 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
 
 	/* setup buttons */
 
@@ -3629,142 +3652,50 @@
 	gtk_widget_show(cancel_button_box);
 
 	gtk_container_add(GTK_CONTAINER(cancel_button), cancel_button_box);
-	
+
 	/* End of Cancel Button */
 	
-	angel_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, angel_xpm );
-	angel_p = gtk_pixmap_new(angel_i, mask);
-	gtk_widget_show(angel_p);
-	bigsmile_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, bigsmile_xpm );
-	bigsmile_p = gtk_pixmap_new(bigsmile_i, mask);
-	gtk_widget_show(bigsmile_p);
-	burp_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, burp_xpm );
-	burp_p = gtk_pixmap_new(burp_i, mask);
-	gtk_widget_show(burp_p);
-	crossedlips_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, crossedlips_xpm );
-	crossedlips_p = gtk_pixmap_new(crossedlips_i, mask);
-	gtk_widget_show(crossedlips_p);
-	cry_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, cry_xpm );
-	cry_p = gtk_pixmap_new(cry_i, mask);
-	gtk_widget_show(cry_p);
-	embarrassed_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, embarrassed_xpm );
-	embarrassed_p = gtk_pixmap_new(embarrassed_i, mask);
-	gtk_widget_show(embarrassed_p);
-	kiss_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, kiss_xpm );
-	kiss_p = gtk_pixmap_new(kiss_i, mask);
-	gtk_widget_show(kiss_p);
-	moneymouth_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, moneymouth_xpm );
-	moneymouth_p = gtk_pixmap_new(moneymouth_i, mask);
-	gtk_widget_show(moneymouth_p);
-	sad_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, sad_xpm );
-	sad_p = gtk_pixmap_new(sad_i, mask);
-	gtk_widget_show(sad_p);
-	scream_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, scream_xpm );
-	scream_p = gtk_pixmap_new(scream_i, mask);
-	gtk_widget_show(scream_p);
-	smile_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, smile_xpm );
-	smile_p = gtk_pixmap_new(smile_i, mask);
-	gtk_widget_show(smile_p);
-	smile8_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, smile8_xpm );
-	smile8_p = gtk_pixmap_new(smile8_i, mask);
-	gtk_widget_show(smile8_p);
-	think_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, think_xpm );
-	think_p = gtk_pixmap_new(think_i, mask);
-	gtk_widget_show(think_p);
-	tongue_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, tongue_xpm );
-	tongue_p = gtk_pixmap_new(tongue_i, mask);
-	gtk_widget_show(tongue_p);
-	wink_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, wink_xpm );
-	wink_p = gtk_pixmap_new(wink_i, mask);
-	gtk_widget_show(wink_p);
-	yell_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
-	     &win->style->white, yell_xpm );
-	yell_p = gtk_pixmap_new(yell_i, mask);
-	gtk_widget_show(yell_p);
-
 	/* pack buttons */
-	angel = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert angel face"), _("Angel"), angel_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_ANGEL);
-	bigsmile = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert big smiley face"), _("Big smile"), bigsmile_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_BIGSMILE);
-	burp = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert burping face"), _("Burp"), burp_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_BURP);
-	crossedlips = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert crossed lips face"), _("Crossed lips"), crossedlips_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_CROSSEDLIPS);
-	cry = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert crying face"), _("Cry"), cry_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_CRY);
-	embarrassed = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert embarrassedl face"), _("Embarrassed"), embarrassed_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_EMBARRASSED);
-	kiss = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert kissing face"), _("Kiss"), kiss_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_KISS);
-	moneymouth = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_1), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert money mouth face"), _("Money mouth"), moneymouth_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_MONEYMOUTH);
-	sad = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert sad face"), _("Sad"), sad_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_SAD);
-	scream = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert screaming face"), _("Scream"), scream_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_SCREAM);
-	smile = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert smiley face"), _("Smile"), smile_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_SMILE);
-	smile8 = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert big-eyed smiley face"), _("Smile8"), smile8_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_SMILE8);
-	think = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert thinking face"), _("Think"), think_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_THINK);
-	tongue = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert tongue face"), _("Tongue"), tongue_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_TONGUE);
-	wink = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert winking face"), _("Wink"), wink_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_WINK);
-	yell = gtk_toolbar_append_element(GTK_TOOLBAR(smiley_box_2), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, _("Insert yelling face"), _("Yell"), yell_p, GTK_SIGNAL_FUNC(set_smiley_array), (int *)FACE_YELL);
+	toolbar_add_smiley(c, smiley_box_1, angel_xpm, win, FACE_ANGEL);
+	toolbar_add_smiley(c, smiley_box_1, bigsmile_xpm, win, FACE_BIGSMILE);
+	toolbar_add_smiley(c, smiley_box_1, burp_xpm, win, FACE_BURP);
+	toolbar_add_smiley(c, smiley_box_1, crossedlips_xpm, win, FACE_CROSSEDLIPS);
+
+	toolbar_add_smiley(c, smiley_box_2, cry_xpm, win, FACE_CRY);
+	toolbar_add_smiley(c, smiley_box_2, embarrassed_xpm, win, FACE_EMBARRASSED);
+	toolbar_add_smiley(c, smiley_box_2, kiss_xpm, win, FACE_KISS);
+	toolbar_add_smiley(c, smiley_box_2, moneymouth_xpm, win, FACE_MONEYMOUTH);
+
+	toolbar_add_smiley(c, smiley_box_3, sad_xpm, win, FACE_SAD);
+	toolbar_add_smiley(c, smiley_box_3, scream_xpm, win, FACE_SCREAM);
+	toolbar_add_smiley(c, smiley_box_3, smile_xpm, win, FACE_SMILE);
+	toolbar_add_smiley(c, smiley_box_3, smile8_xpm, win, FACE_SMILE8);
+
+	toolbar_add_smiley(c, smiley_box_4, think_xpm, win, FACE_THINK);
+	toolbar_add_smiley(c, smiley_box_4, tongue_xpm, win, FACE_TONGUE);
+	toolbar_add_smiley(c, smiley_box_4, wink_xpm, win, FACE_WINK);
+	toolbar_add_smiley(c, smiley_box_4, yell_xpm, win, FACE_YELL);
 
 	/* pack containers */
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), cancel_button, FALSE, FALSE, 10);
 	gtk_box_pack_start(GTK_BOX(vbox), smiley_box_1, TRUE, TRUE, 0);
 	gtk_box_pack_start(GTK_BOX(vbox), smiley_box_2, TRUE, TRUE, 0);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
+	gtk_box_pack_start(GTK_BOX(vbox), smiley_box_3, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), smiley_box_4, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), cancel_button, FALSE, FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(frame), vbox);
+	gtk_container_add(GTK_CONTAINER(dialog), frame);
+	gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
 
 	/* connect signals */
 	gtk_signal_connect(GTK_OBJECT(cancel_button), "clicked", GTK_SIGNAL_FUNC(close_smiley_dialog), c);
-	gtk_signal_connect(GTK_OBJECT(angel), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(bigsmile), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(burp), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(crossedlips), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(cry), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(embarrassed), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(kiss), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(moneymouth), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(sad), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(scream), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(smile), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(smile8), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(think), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(tongue), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(wink), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	gtk_signal_connect(GTK_OBJECT(yell), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
-	
 	/* show everything */
 	if (display_options & OPT_DISP_COOL_LOOK)
 		gtk_button_set_relief(GTK_BUTTON(cancel_button), GTK_RELIEF_NONE);
 		
-	gtk_button_set_relief(GTK_BUTTON(angel), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(bigsmile), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(burp), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(crossedlips), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(cry), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(embarrassed), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(kiss), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(moneymouth), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(sad), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(scream), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(smile), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(smile8), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(think), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(tongue), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(wink), GTK_RELIEF_NONE);
-	gtk_button_set_relief(GTK_BUTTON(yell), GTK_RELIEF_NONE);
-
 	gtk_window_set_title(GTK_WINDOW(dialog), _("Smile!"));
-	gtk_widget_show_all(dialog);
 
 	c->smiley_dialog = dialog;
+	gtk_widget_show_all(dialog);
 	
 	return;
 }
--- a/src/perl.c	Wed Aug 02 02:28:45 2000 +0000
+++ b/src/perl.c	Wed Aug 02 04:53:00 2000 +0000
@@ -28,8 +28,8 @@
 #endif
 #undef PACKAGE
 
-/*#ifdef USE_PERL /**/
-#if 0 /**/
+#ifdef USE_PERL /**/
+/*#if 0 /**/
 
 #include <EXTERN.h>
 #ifndef _SEM_SEMUN_UNDEFINED
@@ -60,23 +60,25 @@
 static GList *perl_timeout_handlers = NULL;
 static PerlInterpreter *my_perl = NULL;
 
-XS (XS_AIM_register);			/* so far so good */
-/* XS (XS_AIM_add_message_handler);	/* um... */
-/* XS (XS_AIM_add_command_handler);	/* once again, um... */
-/* XS (XS_AIM_add_print_handler);	/* can i really do this? */
-XS (XS_AIM_add_timeout_handler);	/* ok, this i can do */
-/* XS (XS_AIM_print);			/* how am i going to do this */
-/* XS (XS_AIM_print_with_channel);	/* print_to_conversation? */
-/* XS (XS_AIM_send_raw);		/* this i can do for toc, but for oscar... ? */
-XS (XS_AIM_command);			/* this should be easier */
-/* XS (XS_AIM_command_with_server);	/* FIXME: this should probably be removed */
-XS (XS_AIM_channel_list);		/* probably return conversation list (online buddies?) */
-/* XS (XS_AIM_server_list);		/* huh? does this apply? */
-XS (XS_AIM_user_list);			/* return the buddy list */
-/* XS (XS_AIM_user_info);		/* we'll see.... */
-XS (XS_AIM_ignore_list);		/* deny list? */
-/* XS (XS_AIM_dcc_list);		/* wha? */
-XS (XS_AIM_get_info);			/* this i can do too */
+/* dealing with gaim */
+XS(XS_AIM_register);
+XS(XS_AIM_get_info);
+XS(XS_AIM_print); /* lemme figure this one out... */
+
+/* list stuff */
+XS(XS_AIM_buddy_list);
+XS(XS_AIM_online_list);
+XS(XS_AIM_deny_list); /* also returns permit list */
+
+/* server stuff */
+XS(XS_AIM_command);
+XS(XS_AIM_user_info); /* given name, return struct buddy members */
+
+/* handler commands */
+XS(XS_AIM_add_message_handler);
+XS(XS_AIM_add_command_handler);
+XS(XS_AIM_add_timeout_handler);
+
 
 /* perl module support */
 extern void xs_init _((void));
@@ -155,22 +157,19 @@
 #endif
 
 	newXS ("AIM::register", XS_AIM_register, "AIM");
-/*	newXS ("AIM::add_message_handler", XS_AIM_add_message_handler, "AIM"); */
-/*	newXS ("AIM::add_command_handler", XS_AIM_add_command_handler, "AIM"); */
-/*	newXS ("AIM::add_print_handler", XS_AIM_add_print_handler, "AIM"); */
-	newXS ("AIM::add_timeout_handler", XS_AIM_add_timeout_handler, "AIM");
-/*	newXS ("AIM::print", XS_AIM_print, "AIM"); */
-/*	newXS ("AIM::print_with_channel", XS_AIM_print_with_channel, "AIM"); */
-/*	newXS ("AIM::send_raw", XS_AIM_send_raw, "AIM"); */
+	newXS ("AIM::get_info", XS_AIM_get_info, "AIM");
+	newXS ("AIM::print", XS_AIM_print, "AIM");
+
+	newXS ("AIM::buddy_list", XS_AIM_buddy_list, "AIM");
+	newXS ("AIM::online_list", XS_AIM_online_list, "AIM");
+	newXS ("AIM::deny_list", XS_AIM_deny_list, "AIM");
+
 	newXS ("AIM::command", XS_AIM_command, "AIM");
-/*	newXS ("AIM::command_with_server", XS_AIM_command_with_server, "AIM"); */
-	newXS ("AIM::channel_list", XS_AIM_channel_list, "AIM");
-/*	newXS ("AIM::server_list", XS_AIM_server_list, "AIM"); */
-	newXS ("AIM::user_list", XS_AIM_user_list, "AIM");
-/*	newXS ("AIM::user_info", XS_AIM_user_info, "AIM"); */
-	newXS ("AIM::ignore_list", XS_AIM_ignore_list, "AIM");
-/*	newXS ("AIM::dcc_list", XS_AIM_dcc_list, "AIM"); */
-	newXS ("AIM::get_info", XS_AIM_get_info, "AIM");
+	newXS ("AIM::user_info", XS_AIM_user_info, "AIM");
+
+	newXS ("AIM::add_message_handler", XS_AIM_add_message_handler, "AIM");
+	newXS ("AIM::add_command_handler", XS_AIM_add_command_handler, "AIM");
+	newXS ("AIM::add_timeout_handler", XS_AIM_add_timeout_handler, "AIM");
 
 	/* FIXME */
 	if (autoload) {
@@ -232,9 +231,85 @@
 	XSRETURN (1);
 }
 
-/* XS (XS_AIM_add_message_handler);	/* um... */
-/* XS (XS_AIM_add_command_handler);	/* once again, um... */
-/* XS (XS_AIM_add_print_handler);	/* can i really do this? */
+XS (XS_AIM_get_info)
+{
+	int junk;
+	dXSARGS;
+	items = 0;
+
+	switch(atoi(SvPV(ST(0), junk))) {
+	case 0:
+		XST_mPV(0, VERSION);
+		break;
+	case 1:
+		XST_mPV(0, current_user->username);
+		break;
+	/* FIXME */
+	default:
+		XST_mPV(0, "Error2");
+	}
+
+	XSRETURN(1);
+}
+
+XS (XS_AIM_print)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_buddy_list)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_online_list)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_deny_list)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_command)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_user_info)
+{
+	int junk;
+	struct buddy *buddy;
+	char *nick;
+	dXSARGS;
+	items = 0;
+
+	nick = SvPV(ST(0), junk);
+	if (!nick[0])
+		XSRETURN(0);
+	buddy = find_buddy(nick);
+	if (!buddy)
+		XSRETURN(0);
+	XST_mPV(0, buddy->name);
+	XST_mPV(1, buddy->present ? "Online" : "Offline");
+	XST_mIV(2, buddy->evil);
+	XST_mIV(3, buddy->signon);
+	XST_mIV(4, buddy->idle);
+	XST_mIV(5, buddy->uc);
+	XST_mIV(6, buddy->caps);
+	XSRETURN(6);
+}
+
+XS (XS_AIM_add_message_handler)
+{
+	/* FIXME */
+}
+
+XS (XS_AIM_add_command_handler)
+{
+	/* FIXME */
+}
 
 static int perl_timeout(struct _perl_timeout_handlers *handler)
 {
@@ -262,52 +337,4 @@
 	XSRETURN_EMPTY;
 }
 
-/* XS (XS_AIM_print);			/* how am i going to do this */
-/* XS (XS_AIM_print_with_channel);	/* print_to_conversation? */
-/* XS (XS_AIM_send_raw);		/* this i can do for toc, but for oscar... ? */
-
-XS (XS_AIM_command)
-{
-}
-
-/* XS (XS_AIM_command_with_server);	/* FIXME: this should probably be removed */
-
-XS (XS_AIM_channel_list)		/* online buddies? */
-{
-}
-
-/* XS (XS_AIM_server_list);		/* huh? does this apply? */
-
-XS (XS_AIM_user_list)			/* buddy list */
-{
-}
-
-/* XS (XS_AIM_user_info);		/* we'll see.... */
-
-XS (XS_AIM_ignore_list)			/* deny list */
-{
-}
-
-/* XS (XS_AIM_dcc_list);		/* wha? */
-
-XS (XS_AIM_get_info)
-{
-	int junk;
-	dXSARGS;
-	items = 0;
-
-	switch(atoi(SvPV(ST(0), junk))) {
-	case 0:
-		XST_mPV(0, VERSION);
-		break;
-	case 1:
-		XST_mPV(0, current_user->username);
-		break;
-	default:
-		XST_mPV(0, "Error2");
-	}
-
-	XSRETURN(1);
-}
-
 #endif /* USE_PERL */