Binary file htdocs/eric/gaim-0.12.0pre20010725.tar.gz has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/gaim.diff Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,12 @@
+--- ../../../icqlib/icqlib/socketmanager.h Mon Jun 4 20:36:31 2001 ++++ socketmanager.h Sat Jun 9 07:37:26 2001
++typedef unsigned int socklen_t; + #include <sys/socket.h> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/gendiff.sh Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,19 @@
+cd /usr/local/src/gaim/libfaim/src + diff -Nu --ignore-matching-lines=\\\$Id$ $i ../../app/src/protocols/oscar/$i +cd /usr/local/src/gaim/libfaim/include + diff -Nu --ignore-matching-lines=\\\$Id$ $i ../../app/src/protocols/oscar/$i +cd /usr/local/src/gaim/icqlib/icqlib + diff -Nu --ignore-matching-lines=\\\$Id$ $i ../../app/src/protocols/icq/$i +cd /usr/local/src/gaim/icqlib/icqlib + diff -Nu --ignore-matching-lines=\\\$Id$ $i ../../app/src/protocols/icq/$i --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/gtk2.shtml Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,70 @@
+<!--#include virtual="/header.shtml"--> +<h1>Compiling Gaim with GTK 2</h1> +GTK 2 is supposed to be released at the end of June or maybe in July sometime. +So I figured I should probably get off my lazy ass and see how hard it was going +to be to port Gaim to GTK 2. +<P>If I take the easy way, it turns out to be rather easy. 700-line <a +href="broken.diff">diff</a> easy, and 165 of those lines are just removing the +GNOME stuff from ./configure so that GTK 2 gets used instead of it. So here's +how to use that diff. (Please don't ask me questions about this, I'm not +supporting any of it, and especially, this is the BROKEN way of porting gaim, so +I'm not taking bug reports.) +<P><B>Step 1. Make sure you're using GTK 1.2.9 or higher currently</B> +<BR>You're going to have to install GTK 2 in order to use this patch, and if +you don't want to completely fuck up your system, you're going to want to keep +GTK 1.2 installed. GTK 1.2.9 has the nice properly that it can coexist with +GTK 2; GTK 1.2.8 cannot. So make sure you're using 1.2.9 or higher (I'm actually +<P><B>Step 2. Install pkg-config</B> +<BR><a href="http://www.freedesktop.org/software/pkgconfig/">pkg-config</a> is the replacement +for glib-config, gtk-config, et al. You'll need to install it before you can +<P><B>Step 3. Get glib, pango, and gtk+ out of GNOME's CVS</B> +<BR>The patch isn't meant for GTK 1.3.5 (which is the last development release, +AFAIK). There were changes to the GdkPixbuf API between 1.3.5 and what's +currently in CVS, and this diff makes use of those changes. So get the glib, +pango, and gtk+ modules out of GNOME's CVS. Do this by first logging in: +<P><code>cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome login</code> +<BR><font size=-1>Hit Enter at the password prompt</font> +<P>And then check out each module: +<P><code>cvs -d :pserver:anonymous@anoncvs.gnome.org;/cvs/gnome co -r HEAD glib</code> +<BR><code>cvs -d :pserver:anonymous@anoncvs.gnome.org;/cvs/gnome co -r HEAD pango</code> +<BR><code>cvs -d :pserver:anonymous@anoncvs.gnome.org;/cvs/gnome co -r HEAD gtk+</code> +<P><B>Step 4. Compile glib, pango, and gtk+</B> +<BR>I'm not going to give real detailed directions for this, because you should +be familiar with using software from CVS. But basically it's just the normal +./autogen.sh ; make ; make install. You need to have at least libtool 1.4 +installed though, and automake 1.4-p1 as well. +<P><B>Step 5. Get Gaim out of CVS</B> +<BR>You should know how to do this by now. Directions are <a +href="/cvs.shtml">here</a>. +<P><B>Step 6. Apply the patch</B> +<BR>OK, for those of you who have never applied a patch before, what you're +going to do is this. Go to the top level of the Gaim CVS tree you just checked +<P><code>patch -p0 <../path/to/broken.diff</code> +<P>Make sure to give the right path to the patch. The 'patch' program will then +tell you which files it's patching, and how cleanly they applied. +<p><B>Step 7. Compile Gaim and use it</B> +<BR>Now you just need to do the normal ./autogen.sh ; make that you do for your +regular CVS tree. Have fun with it. +<!--#include virtual="/footer.shtml"--) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/gtkcount.sh Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,5 @@
+for i in icq irc jabber msn napster oscar toc yahoo zephyr + grep g\[td\]k $i/*.c | wc -l --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/idle.c Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,152 @@
+/* a nifty little plugin to set your idle time to whatever you want it to be. + * useful for almost nothing. mostly just a demo plugin. but it's fun to have +#include "pixmaps/ok.xpm" +#include "pixmaps/cancel.xpm" +static GtkWidget *idlewin = NULL; +static struct gaim_connection *gc = NULL; + return "Allows you to hand-configure how long you've been idle for"; +char *gaim_plugin_init(GModule *module) { +static void des_idle_win(GtkWidget *win, gpointer data) { + gtk_widget_destroy(idlewin); +static void set_idle(GtkWidget *button, GtkWidget *spinner) { + int tm = CLAMP(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinner)), 0, G_MAXINT); + des_idle_win(idlewin, NULL); + debug_printf("setting idle time for %s to %d\n", gc->username, tm); + serv_set_idle(gc, 60 * tm); + des_idle_win(idlewin, NULL); +static void unset_idle(GtkWidget *button, GtkWidget *spinner) { + des_idle_win(idlewin, NULL); +static void sel_gc(GtkWidget *opt, struct gaim_connection *g) { +static void make_connect_menu(GtkWidget *box) { + GtkWidget *optmenu, *menu, *opt; + GSList *c = connections; + struct gaim_connection *g; + optmenu = gtk_option_menu_new(); + gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5); + g = (struct gaim_connection *)c->data; + opt = gtk_menu_item_new_with_label(g->username); + gtk_signal_connect(GTK_OBJECT(opt), "activate", + GTK_SIGNAL_FUNC(sel_gc), g); + gtk_menu_append(GTK_MENU(menu), opt); + gtk_option_menu_remove_menu(GTK_OPTION_MENU(optmenu)); + gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); + gc = connections->data; +char *gaim_plugin_config() { + gtk_widget_show(idlewin); + idlewin = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_window_set_title(GTK_WINDOW(idlewin), "Idle Time"); + gtk_window_set_policy(GTK_WINDOW(idlewin), 0, 0, 1); + gtk_window_set_wmclass(GTK_WINDOW(idlewin), "idle", "gaim"); + gtk_widget_realize(idlewin); + aol_icon(idlewin->window); + gtk_signal_connect(GTK_OBJECT(idlewin), "destroy", + GTK_SIGNAL_FUNC(des_idle_win), NULL); + frame = gtk_frame_new("Idle Time"); + gtk_container_add(GTK_CONTAINER(idlewin), frame); + vbox = gtk_vbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(frame), vbox); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + label = gtk_label_new("Set"); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); + make_connect_menu(hbox); + label = gtk_label_new("idle for"); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); + adj = (GtkAdjustment *)gtk_adjustment_new(10, 0, G_MAXINT, 1, 0, 0); + spinner = gtk_spin_button_new(adj, 0, 0); + gtk_box_pack_start(GTK_BOX(hbox), spinner, TRUE, TRUE, 0); + label = gtk_label_new("minutes."); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); + hbox = gtk_hbox_new(TRUE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + button = picture_button(idlewin, _("Set"), ok_xpm); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_idle), spinner); + button = picture_button(idlewin, _("Cancel"), cancel_xpm); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(unset_idle), spinner); + gtk_widget_show_all(idlewin); +void gaim_plugin_remove() { + gtk_widget_destroy(idlewin); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/index.shtml Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,65 @@
+<!--#include virtual="/header.shtml"--> +<h1>Eric's Page of Cool Stuff</h1> +So I've been hacking Gaim for a little over a year now, and I've come up +with some things that I think are pretty neat. So here they are for all +of you to have. Everything will be dated because I don't really intend +to keep this very up-to-date. Don't send me bug reports about any of this, +YAYOR, YMMV, etc., etc. Feel free to send patches for any of these things. +<P><B>June 6, 2001: </b><a href="gtk2.shtml">Directions</a> for getting +Gaim to compile using <a href="http://www.gtk.org/">GTK 2</a> (still in CVS) +<P><B>June 6, 2001: </b><a href="idle.c">Plugin</a> to set the idle time +<P><B>June 6, 2001: </b><a href="base64.c">Base64</a> converter. Copied +from Gaim code to bug test it. +<P><B>June 6, 2001: </b><a href="pixbuf.shtml">GdkPixbuf</a> tests that +I did (with sample animations too, thanks mid and elnscott). +<P><B>June 9, 2001: </b><a href="gaim.diff">Diff</a> against icqlib from CVS and +<a href="makediff.sh">script</a> I use to make the diff. Very me-specific. I +don't know why I'm posting this. +<P><B>June 9, 2001: </b><a href="mid.diff">Patch</a> I made for mid so that he +could have the conversation tabs and chat tabs in the buddy list. Very buggy but +<P><B>June 14, 2001: </b><a href="design.txt">Design ideas</a> for what Gaim +might be like in the future. +<P><B>July 26, 2001: </b><a href="gaim-0.12.0pre20010725.tar.gz">Gaim +0.12.0pre20010725 tarball</a> for a quick look at some implementation ideas for +<P><B>July 26, 2001: </b><a href="roadmap.txt">Roadmap</a> for where I'd like to +<P><B>August 28, 2001: </b><a href="gendiff.sh">Script</a> to generate the diffs +between icqlib and libfaim and gaim's copy of them. I don't know why I'm posting +<P><B>August 28, 2001: </b><a href="gtkcount.sh">Script</a> to count the number +of lines still containing either "gtk" or "gdk" (case-insensitive) left in the +<P><B>August 29, 2001: </b><a href="broken2.diff">New diff</a> for getting gaim +to work with GTK 2. --enable-gtk2, otherwise it'll use GTK 1.2. No guarantees +<P><B>September 5, 2001: </b><a href="tricks.shtml">Tricks</a> that you can do +by modifying gaim's source. +<P><B>September 6, 2001: </b><a href="autoadd.c">Plugin</a> to automatically add +people to your buddy list when they IM you. +<P><B>September 6, 2001: </b><a href="maxconvo.c">Plugin</a> to limit the number +of conversation windows. +<!--#include virtual="/footer.shtml"--> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/m.c Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,55 @@
+static void deswin(GtkObject *o, gpointer d) + gtk_widget_destroy(GTK_WIDGET(o)); +static void newwin(GtkObject *o, gpointer d) + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_signal_connect(GTK_OBJECT(window), "delete_event", deswin, NULL); + sw = gtk_scrolled_window_new(NULL, NULL); + gtk_container_add(GTK_CONTAINER(window), sw); + imhtml = gtk_imhtml_new(NULL, NULL); + gtk_container_add(GTK_CONTAINER(sw), imhtml); + gtk_widget_show_all(window); +int main(int argc, char **argv) + gtk_init(&argc, &argv); + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_signal_connect(GTK_OBJECT(window), "delete_event", + GTK_SIGNAL_FUNC(gtk_main_quit), NULL); + hbox = gtk_hbox_new(TRUE, 5); + gtk_container_add(GTK_CONTAINER(window), hbox); + button = gtk_button_new_with_label("Open"); + gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", newwin, NULL); + button = gtk_button_new_with_label("Quit"); + gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", + GTK_SIGNAL_FUNC(gtk_main_quit), NULL); + gtk_widget_show_all(window); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/makediff.sh Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,2 @@
+for i in *.[ch] ; do diff -u ../../../icqlib/icqlib/$i $i >>gaim.diff 2>/dev/null ; done --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/maxconvo.c Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,107 @@
+#include "pixmaps/ok.xpm" +#include "pixmaps/cancel.xpm" +static GtkWidget *idlewin = NULL; + return "Convo Limiter"; + return "Allows you to limit max # of conversations"; +static void im_handler(struct gaim_connection *gc, char *who, char **text, void *data) { + if (find_conversation(who)) + if (g_list_length(conversations) >= maxnum) { + serv_send_im(gc, who, "Already engaged in Maximum # of conversations, please try again later.", 1); +char *gaim_plugin_init(GModule *module) { + gaim_signal_connect(module, event_im_recv, im_handler, NULL); +static void des_idle_win(GtkWidget *win, gpointer data) { + gtk_widget_destroy(idlewin); +static void set_idle(GtkWidget *button, GtkWidget *spinner) { + maxnum = CLAMP(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinner)), 0, G_MAXINT); + des_idle_win(idlewin, NULL); +static void unset_idle(GtkWidget *button, GtkWidget *spinner) { + des_idle_win(idlewin, NULL); +char *gaim_plugin_config() { + gtk_widget_show(idlewin); + idlewin = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_window_set_title(GTK_WINDOW(idlewin), "Idle Time"); + gtk_window_set_policy(GTK_WINDOW(idlewin), 0, 0, 1); + gtk_window_set_wmclass(GTK_WINDOW(idlewin), "idle", "gaim"); + gtk_widget_realize(idlewin); + aol_icon(idlewin->window); + gtk_signal_connect(GTK_OBJECT(idlewin), "destroy", + GTK_SIGNAL_FUNC(des_idle_win), NULL); + frame = gtk_frame_new("Idle Time"); + gtk_container_add(GTK_CONTAINER(idlewin), frame); + vbox = gtk_vbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(frame), vbox); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + label = gtk_label_new("idle for"); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); + adj = (GtkAdjustment *)gtk_adjustment_new(10, 0, G_MAXINT, 1, 0, 0); + spinner = gtk_spin_button_new(adj, 0, 0); + gtk_box_pack_start(GTK_BOX(hbox), spinner, TRUE, TRUE, 0); + label = gtk_label_new("minutes."); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); + hbox = gtk_hbox_new(TRUE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + button = picture_button(idlewin, _("Set"), ok_xpm); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_idle), spinner); + button = picture_button(idlewin, _("Cancel"), cancel_xpm); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(unset_idle), spinner); + gtk_widget_show_all(idlewin); +void gaim_plugin_remove() { + gtk_widget_destroy(idlewin); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/mid.diff Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,463 @@
+=================================================================== +RCS file: /cvsroot/gaim/gaim/src/buddy.c,v +retrieving revision 1.228 +--- src/buddy.c 2001/06/08 23:17:16 1.228 ++++ src/buddy.c 2001/06/09 14:40:55
+ GtkWidget *blist = NULL; ++GtkWidget *buddy_notebook; + void BuddyTickerLogonTimeout( gpointer data ); + void BuddyTickerLogoutTimeout( gpointer data ); ++extern void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data); + vbox = gtk_vbox_new(FALSE, 0); +- notebook = gtk_notebook_new(); ++ buddy_notebook = gtk_notebook_new(); ++ gtk_signal_connect(GTK_OBJECT(buddy_notebook), "switch-page", GTK_SIGNAL_FUNC(convo_switch), NULL); + label = gtk_label_new(_("Online")); +- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), buddypane, label); ++ gtk_notebook_append_page(GTK_NOTEBOOK(buddy_notebook), buddypane, label); + label = gtk_label_new(_("Edit Buddies")); +- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), editpane, label); ++ gtk_notebook_append_page(GTK_NOTEBOOK(buddy_notebook), editpane, label); +- gtk_widget_show_all(notebook); ++ gtk_widget_show_all(buddy_notebook); + /* Pack things in the vbox */ +- gtk_widget_show(notebook); ++ gtk_widget_show(buddy_notebook); + gtk_signal_connect(GTK_OBJECT(addbutton), "clicked", GTK_SIGNAL_FUNC(add_buddy_callback), NULL); + gtk_signal_connect(GTK_OBJECT(groupbutton), "clicked", GTK_SIGNAL_FUNC(add_group_callback), NULL); + gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0); +- gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); ++ gtk_box_pack_start(GTK_BOX(vbox), buddy_notebook, TRUE, TRUE, 0); + gtk_container_add(GTK_CONTAINER(blist), vbox); +=================================================================== +RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v +retrieving revision 1.97 +diff -u -r1.97 buddy_chat.c +--- src/buddy_chat.c 2001/05/31 00:40:54 1.97 ++++ src/buddy_chat.c 2001/06/09 14:40:56
+ GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(chat_notebook), + gtk_notebook_get_nth_page(GTK_NOTEBOOK(chat_notebook), page_num)); +- struct conversation *b = g_list_nth_data(chats, page_num); ++ struct conversation *b = g_list_nth_data(chats, page_num - 2 - g_list_length(conversations)); + if (b && b->window && b->entry) + gtk_window_set_focus(GTK_WINDOW(b->window), b->entry); + if (!GTK_WIDGET_REALIZED(label)) + int dispstyle = set_dispstyle(1); +- if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { +- win = all_chats = b->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); +- gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); +- gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); +- gtk_container_border_width(GTK_CONTAINER(win), 0); +- gtk_widget_realize(win); +- aol_icon(win->window); +- gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Group Chats")); +- gtk_signal_connect(GTK_OBJECT(win), "delete_event", +- GTK_SIGNAL_FUNC(delete_all_chats), NULL); ++ win = b->window = blist; +- chat_notebook = gtk_notebook_new(); +- if (display_options & OPT_DISP_CHAT_SIDE_TAB) { +- if (display_options & OPT_DISP_CHAT_BR_TAB) { +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), +- if (display_options & OPT_DISP_CHAT_BR_TAB) { +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), +- gtk_notebook_set_scrollable(GTK_NOTEBOOK(chat_notebook), TRUE); +- gtk_notebook_popup_enable(GTK_NOTEBOOK(chat_notebook)); +- gtk_container_add(GTK_CONTAINER(win), chat_notebook); +- gtk_signal_connect(GTK_OBJECT(chat_notebook), "switch-page", +- GTK_SIGNAL_FUNC(chat_switch), NULL); +- gtk_widget_show(chat_notebook); +- win = b->window = all_chats; +- cont = gtk_vbox_new(FALSE, 5); +- gtk_container_set_border_width(GTK_CONTAINER(cont), 5); +- gtk_notebook_append_page(GTK_NOTEBOOK(chat_notebook), cont, gtk_label_new(b->name)); +- gtk_widget_show(cont); +- win = gtk_window_new(GTK_WINDOW_TOPLEVEL); +- gtk_object_set_user_data(GTK_OBJECT(win), b); +- gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); +- gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); +- gtk_container_border_width(GTK_CONTAINER(win), 10); +- gtk_widget_realize(win); +- aol_icon(win->window); +- g_snprintf(buf, sizeof(buf), "Gaim - %s (chat)", b->name); +- gtk_window_set_title(GTK_WINDOW(win), buf); +- gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(close_callback), b); +- cont = gtk_vbox_new(FALSE,5); +- gtk_container_add(GTK_CONTAINER(win), cont); +- gtk_widget_show(cont); +- if (b->gc->prpl->options & OPT_PROTO_CHAT_TOPIC) { +- hbox = gtk_hbox_new(FALSE, 0); +- gtk_box_pack_start(GTK_BOX(cont), hbox, FALSE, FALSE, 5); +- gtk_widget_show(hbox); +- label = gtk_label_new(_("Topic:")); +- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); +- gtk_widget_show(label); +- b->topic_text = gtk_entry_new(); +- gtk_signal_connect(GTK_OBJECT(b->topic_text), "activate", +- GTK_SIGNAL_FUNC(topic_callback), b); +- gtk_box_pack_start(GTK_BOX(hbox), b->topic_text, TRUE, TRUE, 5); +- gtk_widget_show(b->topic_text); ++ cont = gtk_vbox_new(FALSE, 5); ++ gtk_container_set_border_width(GTK_CONTAINER(cont), 5); ++ gtk_notebook_append_page(GTK_NOTEBOOK(buddy_notebook), cont, gtk_label_new(b->name)); ++ gtk_widget_show(cont); + vpaned = gtk_vpaned_new(); + gtk_paned_set_gutter_size(GTK_PANED(vpaned), 15); +Index: src/conversation.c +=================================================================== +RCS file: /cvsroot/gaim/gaim/src/conversation.c,v +retrieving revision 1.228 +diff -u -r1.228 conversation.c +--- src/conversation.c 2001/06/07 03:12:45 1.228 ++++ src/conversation.c 2001/06/09 14:40:56
+ int close_callback(GtkWidget *widget, struct conversation *c) +- if (c->is_chat && (widget == c->close) && !(display_options & OPT_DISP_ONE_CHAT_WINDOW)) { +- GtkWidget *tmp = c->window; +- debug_printf("chat clicked close button\n"); +- gtk_widget_destroy(tmp); + debug_printf("conversation close callback\n"); + if (general_options & OPT_GEN_CHECK_SPELLING) + gtkspell_detach(GTK_TEXT(c->entry)); +- if (c->gc && c->gc->prpl && c->gc->prpl->remove_convo) +- (*c->gc->prpl->remove_convo)(c->gc, c); +- if (display_options & OPT_DISP_ONE_WINDOW) { +- if (g_list_length(conversations) > 1) { +- gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook), +- g_list_index(conversations, c)); +- gtk_widget_destroy(c->window); +- convo_notebook = NULL; +- gtk_widget_destroy(c->window); ++ gtk_notebook_remove_page(GTK_NOTEBOOK(buddy_notebook), ++ g_list_index(conversations, c) + 2); +- if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { +- if (g_list_length(chats) > 1) { +- gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), +- g_list_index(chats, c)); +- gtk_widget_destroy(c->window); +- gtk_widget_destroy(c->window); ++ gtk_notebook_remove_page(GTK_NOTEBOOK(buddy_notebook), ++ g_list_index(chats, c) + g_list_length(conversations) + 2); + if (c->fg_color_dialog) + gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); +- if ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || +- ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) { +- GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); +- if (event->keyval == '[') { +- gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); +- gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); +- } else if (event->keyval == ']') { +- gtk_notebook_next_page(GTK_NOTEBOOK(notebook)); +- gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); +- } else if (event->keyval == GDK_Tab) { +- GList *ws = (c->is_chat ? chats : conversations); +- GList *cnv = g_list_nth(ws, +- gtk_notebook_get_current_page( +- GTK_NOTEBOOK(notebook))); +- struct conversation *d = NULL; +- gtk_notebook_set_page(GTK_NOTEBOOK(notebook), +- gtk_notebook_set_page( +- GTK_NOTEBOOK(notebook), +- cnv = g_list_last(ws); +- gtk_notebook_set_page( +- GTK_NOTEBOOK(notebook), 0); +- gtk_notebook_next_page( +- GTK_NOTEBOOK(notebook)); +- gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); +- } else if (((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || +- ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) && +- (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) && +- (event->keyval > '0')) { +- GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); +- gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1'); +- gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); + if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) && + ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW) && +- (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook)) +- != g_list_index(conversations, c))) || ++ (gtk_notebook_get_current_page(GTK_NOTEBOOK(buddy_notebook)) ++ != g_list_index(conversations, c) + 2)) || + ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW) && +- (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook)) +- != g_list_index(chats, c))))) { +- GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); ++ (gtk_notebook_get_current_page(GTK_NOTEBOOK(buddy_notebook)) ++ != g_list_index(chats, c) + g_list_length(conversations) + 2)))) { + GList *ws = (c->is_chat ? chats : conversations); +- GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), +- gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), g_list_index(ws, c))); ++ int add = (c->is_chat ? 2 + g_list_length(conversations) : 2); ++ GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(buddy_notebook), ++ gtk_notebook_get_nth_page(GTK_NOTEBOOK(buddy_notebook), ++ g_list_index(ws, c) + add)); + GtkStyle *style = gtk_style_new(); + if (!GTK_WIDGET_REALIZED(label)) + gtk_widget_realize(label); +-static void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data) ++void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data) +- GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook), +- gtk_notebook_get_nth_page(GTK_NOTEBOOK(convo_notebook), page_num)); ++ GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(buddy_notebook), ++ gtk_notebook_get_nth_page(GTK_NOTEBOOK(buddy_notebook), page_num)); +- struct conversation *c = g_list_nth_data(conversations, page_num); ++ struct conversation *c = (page_num >= 2 + g_list_length(conversations)) ? ++ g_list_nth_data(chats, page_num - 2 - g_list_length(conversations)) : ++ page_num >= 2 ? g_list_nth_data(conversations, page_num - 2) : NULL; + if (c && c->window && c->entry) + gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); + if (!GTK_WIDGET_REALIZED(label)) +- if (display_options & OPT_DISP_ONE_WINDOW) { +- win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); +- gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); +- gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); +- gtk_container_border_width(GTK_CONTAINER(win), 0); +- gtk_widget_realize(win); +- aol_icon(win->window); +- gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations")); +- gtk_signal_connect(GTK_OBJECT(win), "delete_event", +- GTK_SIGNAL_FUNC(delete_all_convo), NULL); +- convo_notebook = gtk_notebook_new(); +- if (display_options & OPT_DISP_CONV_SIDE_TAB) { +- if (display_options & OPT_DISP_CONV_BR_TAB) { +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), +- if (display_options & OPT_DISP_CONV_BR_TAB) { +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), +- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), +- gtk_notebook_set_scrollable(GTK_NOTEBOOK(convo_notebook), TRUE); +- gtk_notebook_popup_enable(GTK_NOTEBOOK(convo_notebook)); +- gtk_container_add(GTK_CONTAINER(win), convo_notebook); +- gtk_signal_connect(GTK_OBJECT(convo_notebook), "switch-page", +- GTK_SIGNAL_FUNC(convo_switch), NULL); +- gtk_widget_show(convo_notebook); +- win = c->window = all_convos; ++ win = c->window = blist; +- cont = gtk_vbox_new(FALSE, 5); +- gtk_container_set_border_width(GTK_CONTAINER(cont), 5); +- gtk_notebook_append_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name)); +- gtk_widget_show(cont); +- cont = win = gtk_window_new(GTK_WINDOW_TOPLEVEL); +- gtk_object_set_user_data(GTK_OBJECT(win), c); +- gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); +- gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); +- gtk_container_border_width(GTK_CONTAINER(win), 10); +- gtk_widget_realize(win); +- aol_icon(win->window); +- if ((find_log_info(c->name)) || ((logging_options & OPT_LOG_ALL))) +- g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); +- g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name); +- gtk_window_set_title(GTK_WINDOW(win), buf); +- gtk_signal_connect(GTK_OBJECT(win), "delete_event", +- GTK_SIGNAL_FUNC(delete_event_convo), c); ++ cont = gtk_vbox_new(FALSE, 5); ++ gtk_container_set_border_width(GTK_CONTAINER(cont), 5); ++ gtk_notebook_insert_page(GTK_NOTEBOOK(buddy_notebook), cont, gtk_label_new(c->name), ++ 1 + g_list_length(conversations)); ++ gtk_widget_show(cont); + paned = gtk_vpaned_new(); + gtk_paned_set_gutter_size(GTK_PANED(paned), 15); + void set_convo_tab_label(struct conversation *c, char *text) +- gtk_label_set_text(GTK_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook), +- gtk_notebook_get_nth_page(GTK_NOTEBOOK(convo_notebook), +- g_list_index(conversations, c)))), text); ++ gtk_label_set_text(GTK_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(buddy_notebook), ++ gtk_notebook_get_nth_page(GTK_NOTEBOOK(buddy_notebook), ++ g_list_index(conversations, c) + 2))), text); + void raise_convo_tab(struct conversation *c) +- gtk_notebook_set_page(GTK_NOTEBOOK(convo_notebook), g_list_index(conversations, c)); ++ gtk_notebook_set_page(GTK_NOTEBOOK(buddy_notebook), g_list_index(conversations, c) + 2); + gdk_window_show(c->window->window); +=================================================================== +RCS file: /cvsroot/gaim/gaim/src/gaim.h,v +retrieving revision 1.230 +--- src/gaim.h 2001/06/01 23:56:52 1.230 ++++ src/gaim.h 2001/06/09 14:40:57
+ extern GtkWidget *all_chats; + extern GtkWidget *chat_notebook; ++extern GtkWidget *buddy_notebook; + extern GtkWidget *joinchat; --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/pixbuf.c Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,153 @@
+#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixbuf-loader.h> +GdkPixbufAnimation *anim = NULL; +GdkPixbuf *unanim = NULL; +static gboolean redraw_anim(gpointer data) + GdkPixmap *pm; GdkBitmap *bm; + frames = gdk_pixbuf_animation_get_frames(anim); + frame = g_list_nth_data(frames, curframe); + switch (gdk_pixbuf_frame_get_action(frame)) { + case GDK_PIXBUF_FRAME_RETAIN: + buf = gdk_pixbuf_frame_get_pixbuf(frame); + gdk_pixbuf_render_pixmap_and_mask(buf, &src, NULL, 0); + gtk_pixmap_get(GTK_PIXMAP(pix), &pm, &bm); + gdk_draw_pixmap(pm, gc, src, 0, 0, + gdk_pixbuf_frame_get_x_offset(frame), + gdk_pixbuf_frame_get_y_offset(frame), + gtk_pixmap_set(GTK_PIXMAP(pix), pm, bm); + gtk_widget_queue_draw(pix); + case GDK_PIXBUF_FRAME_DISPOSE: + buf = gdk_pixbuf_frame_get_pixbuf(frame); + gdk_pixbuf_render_pixmap_and_mask(buf, &pm, &bm, 0); + gtk_pixmap_set(GTK_PIXMAP(pix), pm, bm); + case GDK_PIXBUF_FRAME_REVERT: + buf = gdk_pixbuf_frame_get_pixbuf(frame); + gdk_pixbuf_render_pixmap_and_mask(buf, &pm, &bm, 0); + gtk_pixmap_set(GTK_PIXMAP(pix), pm, bm); + curframe = (curframe + 1) % g_list_length(frames); + delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); + timer = gtk_timeout_add(delay * 10, redraw_anim, NULL); +void des_evt(GtkObject *o, gpointer d) + gdk_pixbuf_animation_unref(anim); + gdk_pixbuf_unref(unanim); + gtk_timeout_remove(timer); +int main(int argc, char **argv) + gtk_init(&argc, &argv); + f = fopen(argv[1], "r"); + f = fopen("picture.id", "r"); + length = fread(data, 1, 8192, f); + load = gdk_pixbuf_loader_new(); + gdk_pixbuf_loader_write(load, data, length); + anim = gdk_pixbuf_loader_get_animation(load); + frames = gdk_pixbuf_animation_get_frames(anim); + buf = gdk_pixbuf_frame_get_pixbuf(frames->data); + gdk_pixbuf_render_pixmap_and_mask(buf, &pm, &bm, 0); + if (gdk_pixbuf_animation_get_num_frames(anim) > 1) { + int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); + timer = gtk_timeout_add(delay * 10, redraw_anim, NULL); + unanim = gdk_pixbuf_loader_get_pixbuf(load); + gdk_pixbuf_loader_close(load); + gdk_pixbuf_render_pixmap_and_mask(unanim, &pm, &bm, 0); + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); + gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(des_evt), NULL); + vbox = gtk_hbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(win), vbox); + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + pix = gtk_pixmap_new(pm, bm); + gtk_box_pack_start(GTK_BOX(hbox), pix, FALSE, FALSE, 0); + if (anim && (gdk_pixbuf_animation_get_num_frames(anim) > 1)) + gtk_widget_set_usize(pix, gdk_pixbuf_animation_get_width(anim), + gdk_pixbuf_animation_get_height(anim)); + gdk_pixbuf_loader_close(load); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/pixbuf.shtml Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,30 @@
+<!--#include virtual="/header.shtml"--> +<h1>GdkPixbuf Tests</h1> +When I was adding buddy icons to Gaim I wrote a quick test program that +used GdkPixbuf. You can get a copy of that program <a href="pixbuf.c">here</a>. +<P><code>gcc -o pixbuf pixbuf.c `gdk-pixbuf-config --cflags` `gdk-pixbuf-config +<P>Well, as it turns out, it doesn't display the following images very well: +<P><img src="ABpenguinsAIM.gif" alt="animated penguins"> +<img src="bf.gif" alt="butterfly"> +<img src="ABcherrychopAIM.gif" alt="chopping down a tree"> +<P>So I wrote another quick test program to test GTK 2. You can get a copy +of that program <a href="pixbuf2.c">here</a>. To compile it, run: +<P><code>gcc -o pixbuf2 pixbuf2.c `pkg-config gtk+-x11-2.0 --cflags` `pkg-config +gtk+-x11-2.0 --libs`</code> +<P>Turns out I actually didn't need to write it because there's a testanimation +program in the GTK 2 source that does exactly the same thing. Oh well. Anyway, +if you compare the two you'll see that it's much easier to code and displays +better. Such is the power of GTK 2. +<!--#include virtual="/footer.shtml"--> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/eric/pixbuf2.c Thu Sep 26 06:23:05 2002 -0400
@@ -0,0 +1,64 @@
+#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixbuf-loader.h> +void des_evt(GtkObject *o, gpointer d) +int main(int argc, char **argv) + GdkPixbufAnimation *anim; + gtk_init(&argc, &argv); + f = fopen(argv[1], "r"); + f = fopen("picture.id", "r"); + length = fread(data, 1, 8192, f); + load = gdk_pixbuf_loader_new(); + gdk_pixbuf_loader_write(load, data, length, NULL); + anim = gdk_pixbuf_loader_get_animation(load); + pix = gtk_image_new_from_animation(anim); + gdk_pixbuf_animation_unref(anim); + unanim = gdk_pixbuf_loader_get_pixbuf(load); + pix = gtk_image_new_from_pixbuf(unanim); + gdk_pixbuf_unref(unanim); + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); + gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(des_evt), NULL); + gtk_container_add(GTK_CONTAINER(win), pix); + gdk_pixbuf_loader_close(load, NULL);