Mercurial > pidgin.yaz
changeset 96:247f540ea6e1
[gaim-migrate @ 106]
Okay, this is cool. I think everything finally completely works. You can
even load plugins before you log in now (isn't that nice).
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 09 Apr 2000 18:42:36 +0000 |
parents | 19cffb5bd129 |
children | 5b4b7aa8dd9a |
files | plugins/CRAZY plugins/Makefile plugins/gaiminc.c src/aim.c src/plugins.c |
diffstat | 5 files changed, 56 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/CRAZY Sun Apr 09 11:36:09 2000 +0000 +++ b/plugins/CRAZY Sun Apr 09 18:42:36 2000 +0000 @@ -54,4 +54,7 @@ There's going to be a few plugins that are going to ship with gaim by default eventually, probably. This would be a good thing to put in the PATCHES thing -over at sourceforge.net +over at sourceforge.net, if you write one. Most plugins are probably only going +to be one short file, which is probably how most of them should be (some short +little hack to do the auto-reconnect thing, for example. That can probably be +done in about 10-15 lines).
--- a/plugins/Makefile Sun Apr 09 11:36:09 2000 +0000 +++ b/plugins/Makefile Sun Apr 09 18:42:36 2000 +0000 @@ -2,10 +2,9 @@ CFLAGS = -Wall `gnome-config --cflags gtk` -I../src LDFLAGS = -ggdb `gnome-config --libs gtk` -shared -all: simple.so gaiminc.so +all: simple.so gaiminc.so file_control.so -simple.so: simple.c +.SUFFIXES: .c .so + +.c.so: $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$@ -o $@ $< - -gaiminc.so: gaiminc.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$@ -o $@ $<
--- a/plugins/gaiminc.c Sun Apr 09 11:36:09 2000 +0000 +++ b/plugins/gaiminc.c Sun Apr 09 18:42:36 2000 +0000 @@ -45,3 +45,15 @@ /* this is for doing something fun when a buddy comes online */ gaim_signal_connect(handle, event_buddy_signon, bud, NULL); } + +char *name() { + return "Gaim Demonstration Plugin"; +} + +char *description() { + return "This is a really cool plugin that does a lot of stuff:\n" + "- It tells you who wrote the program when you log in\n" + "- It reverses all incoming text\n" + "- It sends a message to people on your list immediately" + " when they sign on"; +}
--- a/src/aim.c Sun Apr 09 11:36:09 2000 +0000 +++ b/src/aim.c Sun Apr 09 18:42:36 2000 +0000 @@ -239,8 +239,12 @@ void show_login() { GtkWidget *options; +#ifdef GAIM_PLUGINS + GtkWidget *plugs; +#endif GtkWidget *reg; GtkWidget *bbox; + GtkWidget *hbox; GtkWidget *sbox; GtkWidget *label; GtkWidget *table; @@ -263,6 +267,9 @@ cancel = gtk_button_new_with_label("Cancel"); reg = gtk_button_new_with_label("Register"); options = gtk_button_new_with_label("Options"); +#ifdef GAIM_PLUGINS + plugs = gtk_button_new_with_label("Plugins"); +#endif table = gtk_table_new(8, 2, FALSE); name = gtk_combo_new(); pass = gtk_entry_new(); @@ -280,6 +287,11 @@ /* Allow user to change prefs before logging in */ gtk_signal_connect(GTK_OBJECT(options), "clicked", GTK_SIGNAL_FUNC(show_prefs), NULL); +#ifdef GAIM_PLUGINS + /* Allow user to control plugins before logging in */ + gtk_signal_connect(GTK_OBJECT(plugs), "clicked", + GTK_SIGNAL_FUNC(show_plugins), NULL); +#endif /* Register opens the right URL */ gtk_signal_connect(GTK_OBJECT(reg), "clicked", @@ -298,14 +310,20 @@ GTK_SIGNAL_FUNC(cancel_logon), mainwindow); /* Homogenous spacing, 10 padding */ bbox = gtk_hbox_new(TRUE, 10); + hbox = gtk_hbox_new(TRUE, 10); sbox = gtk_vbox_new(TRUE, 10); gtk_box_pack_start(GTK_BOX(bbox), reg, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(bbox), signon, TRUE, TRUE, 0); - + + gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); +#ifdef GAIM_PLUGINS + gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); +#endif + gtk_box_pack_start(GTK_BOX(sbox), bbox, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(sbox), options, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); /* Labels for selectors and text boxes */ #if 0 @@ -324,6 +342,9 @@ gtk_widget_show(remember); gtk_widget_show(options); +#ifdef GAIM_PLUGINS + gtk_widget_show(plugs); +#endif /* Adjust sizes of inputs */ gtk_widget_set_usize(name,95,0); @@ -346,6 +367,7 @@ gtk_widget_show(cancel); gtk_widget_show(reg); gtk_widget_show(bbox); + gtk_widget_show(hbox); gtk_widget_show(sbox); gtk_table_attach(GTK_TABLE(table), sbox, 0,2,7,8,0,0, 5, 5); @@ -442,6 +464,11 @@ _("Signon"), applet_show_login, NULL); + applet_widget_register_callback(APPLET_WIDGET(applet), + "plugins", + _("Plugins"), + GTK_SIGNAL_FUNC(show_plugins), + NULL); if((general_options & OPT_GEN_AUTO_LOGIN) && (general_options & OPT_GEN_REMEMBER_PASS)) {
--- a/src/plugins.c Sun Apr 09 11:36:09 2000 +0000 +++ b/src/plugins.c Sun Apr 09 18:42:36 2000 +0000 @@ -179,6 +179,7 @@ GtkWidget *sw2; GtkWidget *add; GtkWidget *remove; + GtkWidget *close; GList *plugs = plugins; struct gaim_plugin *p; gchar buffer[1024]; @@ -228,6 +229,11 @@ GTK_SIGNAL_FUNC(unload), pluglist); gtk_box_pack_start(GTK_BOX(botbox), remove, TRUE, FALSE, 5); + close = gtk_button_new_with_label("Close"); + gtk_signal_connect(GTK_OBJECT(close), "clicked", + GTK_SIGNAL_FUNC(hide_plugins), NULL); + gtk_box_pack_start(GTK_BOX(botbox), close, TRUE, FALSE, 5); + gtk_box_pack_start(GTK_BOX(page), topbox, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(page), botbox, FALSE, FALSE, 0); @@ -264,6 +270,7 @@ gtk_widget_show(plugtext); gtk_widget_show(add); gtk_widget_show(remove); + gtk_widget_show(close); gtk_container_add(GTK_CONTAINER(plugwindow), page); gtk_widget_show(plugwindow);