annotate src/plugins.c @ 2273:0b5c3338fa3d

[gaim-migrate @ 2283] One of the girls on the floor of my sister's dorm lost both her parents when their plane was hijacked and crashed into the World Trade Center. my girlfriend's boss's sister-in-law's brother died when the building collapsed. my parents flew to atlanta on monday; they're safe but currently stranded there. they had planned on flying to Raleigh, NC today but now are just hoping to be able to fly home soon. how did this happen? committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 12 Sep 2001 21:29:32 +0000
parents eb2cadb18479
children f2150073cd41
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 * ----------------
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 * The Plug-in plug
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23 * Plugin support is currently being maintained by Mike Saraf
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 * msaraf@dwc.edu
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 *
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
26 * Well, I didn't see any work done on it for a while, so I'm going to try
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
27 * my hand at it. - Eric warmenhoven@yahoo.com
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
28 *
1745
c39cc2b44226 [gaim-migrate @ 1755]
Rob Flynn <gaim@robflynn.com>
parents: 1712
diff changeset
29 * Mike is my roomate. I can assure you that he's lazy :-P -- Rob rob@marko.net
c39cc2b44226 [gaim-migrate @ 1755]
Rob Flynn <gaim@robflynn.com>
parents: 1712
diff changeset
30 *
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 176
diff changeset
33 #ifdef HAVE_CONFIG_H
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
34 #include <config.h>
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 176
diff changeset
35 #endif
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 176
diff changeset
36
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include <sys/time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48
885
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
49 #ifdef GAIM_PLUGINS
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
50
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
51 #include <dlfcn.h>
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
52
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
53 #include "pixmaps/gnome_add.xpm"
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
54 #include "pixmaps/gnome_remove.xpm"
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
55 #include "pixmaps/gnome_preferences.xpm"
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
56 #include "pixmaps/refresh.xpm"
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
57 #include "pixmaps/cancel.xpm"
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
58
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
59 #define PATHSIZE 1024 /* XXX: stolen from dialogs.c */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
60
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
61
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
62 /* ------------------ Global Variables ----------------------- */
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
63
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
64 GList *plugins = NULL;
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
65 GList *callbacks = NULL;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
66
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
67 /* ------------------ Local Variables ------------------------ */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
69 static GtkWidget *plugin_dialog = NULL;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
70
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
71 static GtkWidget *pluglist = NULL;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
72 static GtkWidget *plugtext = NULL;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
73 static GtkWidget *plugwindow = NULL;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
74 static GtkWidget *plugentry = NULL;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
75
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
76 static GtkTooltips *tooltips = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
78 static GtkWidget *config = NULL;
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 397
diff changeset
79 static guint confighandle = 0;
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
80 static GtkWidget *reload = NULL;
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
81 static GtkWidget *unload = NULL;
1025
84a5d80e52f1 [gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
82 static char *last_dir = NULL;
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
83
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
84 /* --------------- Function Declarations --------------------- */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
86 void show_plugins(GtkWidget *, gpointer);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
87 void load_plugin(char *);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
88
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
89 void gaim_signal_connect(GModule *, enum gaim_event, void *, void *);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
90 void gaim_signal_disconnect(GModule *, enum gaim_event, void *);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
91 void gaim_plugin_unload(GModule *);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
92
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
93 /* UI button callbacks */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
94 static void plugin_reload_cb(GtkWidget *, gpointer);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
95
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
96 static const gchar *plugin_makelistname(GModule *);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
97 static void plugin_remove_callbacks(GModule *);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
98
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
99 static void plugin_reload(struct gaim_plugin *p);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
100
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
101 static void destroy_plugins(GtkWidget *, gpointer);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
102 static void load_file(GtkWidget *, gpointer);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
103 static void load_which_plugin(GtkWidget *, gpointer);
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
104 static void unload_plugin(GtkWidget *, gpointer);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
105 static void unload_immediate(GModule *);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
106 static void list_clicked(GtkWidget *, struct gaim_plugin *);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
107 static void update_show_plugins();
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
108 static void hide_plugins(GtkWidget *, gpointer);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
109
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 /* ------------------ Code Below ---------------------------- */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
112 static void destroy_plugins(GtkWidget *w, gpointer data)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
113 {
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
114 if (plugin_dialog)
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
115 gtk_widget_destroy(plugin_dialog);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
116 plugin_dialog = NULL;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
117 }
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
118
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
119 static void load_file(GtkWidget *w, gpointer data)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 {
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
121 gchar *buf;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
122
138
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
123 if (plugin_dialog) {
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
124 gtk_widget_show(plugin_dialog);
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
125 gdk_window_raise(plugin_dialog->window);
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
126 return;
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
127 }
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
128
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
129 plugin_dialog = gtk_file_selection_new(_("Gaim - Plugin List"));
138
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
130
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
131 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(plugin_dialog));
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
132
1025
84a5d80e52f1 [gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
133 if (!last_dir)
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1145
diff changeset
134 buf = g_strdup(LIBDIR);
153
8ed64c704fb0 [gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 142
diff changeset
135 else
1025
84a5d80e52f1 [gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
136 buf = g_strconcat(last_dir, G_DIR_SEPARATOR_S, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
138 gtk_file_selection_set_filename(GTK_FILE_SELECTION(plugin_dialog), buf);
153
8ed64c704fb0 [gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 142
diff changeset
139 gtk_file_selection_complete(GTK_FILE_SELECTION(plugin_dialog), "*.so");
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
140 gtk_signal_connect(GTK_OBJECT(plugin_dialog), "destroy",
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
141 GTK_SIGNAL_FUNC(destroy_plugins), plugin_dialog);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
142
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
143 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->ok_button),
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
144 "clicked", GTK_SIGNAL_FUNC(load_which_plugin), NULL);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
145
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
146 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->cancel_button),
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
147 "clicked", GTK_SIGNAL_FUNC(destroy_plugins), NULL);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
148
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
149 g_free(buf);
626
d86cc11faab8 [gaim-migrate @ 636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
150 gtk_widget_show(plugin_dialog);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
151 gdk_window_raise(plugin_dialog->window);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
152 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
154 static void load_which_plugin(GtkWidget *w, gpointer data)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
155 {
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
156 char *file;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
157
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
158 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(plugin_dialog));
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
159 if (file_is_dir(file, plugin_dialog)) {
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
160 return;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
161 }
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1025
diff changeset
162
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
163 if (file)
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
164 load_plugin(file);
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
165
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
166 if (plugin_dialog)
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
167 gtk_widget_destroy(plugin_dialog);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
168 plugin_dialog = NULL;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
169 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 139
diff changeset
170
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
171 void load_plugin(char *filename)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
172 {
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
173 struct gaim_plugin *plug;
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
174 GList *c = plugins;
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
175 char *(*gaim_plugin_init)(GModule *);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
176 char *(*cfunc)();
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
177 char *error;
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
178 char *retval;
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
179
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
180 if (!g_module_supported())
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
181 return;
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
182 if (filename && !strlen(filename))
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
183 return;
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
184
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
185 while (filename && c) {
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
186 plug = (struct gaim_plugin *)c->data;
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
187 if (!strcmp(filename, g_module_name(plug->handle))) {
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
188 /* just need to reload plugin */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
189 plugin_reload(plug);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
190 return;
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
191 } else
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
192 c = g_list_next(c);
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
193 }
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
194 plug = g_malloc(sizeof *plug);
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
195
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
196 if (filename) {
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
197 if (last_dir)
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
198 g_free(last_dir);
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
199 last_dir = g_dirname(filename);
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1429
diff changeset
200 }
1025
84a5d80e52f1 [gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
201
1236
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1185
diff changeset
202 debug_printf("Loading %s\n", filename);
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1185
diff changeset
203 plug->handle = g_module_open(filename, 0);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
204 if (!plug->handle) {
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
205 error = (char *)g_module_error();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
206 do_error_dialog(error, _("Plugin Error"));
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
207 g_free(plug);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
208 return;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
209 }
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
210
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
211 if (!g_module_symbol(plug->handle, "gaim_plugin_init", (gpointer *)&gaim_plugin_init)) {
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
212 do_error_dialog(g_module_error(), _("Plugin Error"));
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
213 g_module_close(plug->handle);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
214 g_free(plug);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
215 return;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
216 }
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
217
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
218 retval = (*gaim_plugin_init)(plug->handle);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
219 debug_printf("loaded plugin returned %s\n", retval ? retval : "NULL");
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
220 if (retval) {
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
221 plugin_remove_callbacks(plug->handle);
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
222 do_error_dialog(retval, _("Plugin Error"));
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
223 g_module_close(plug->handle);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
224 g_free(plug);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
225 return;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
226 }
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
227
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
228 plugins = g_list_append(plugins, plug);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
230 if (g_module_symbol(plug->handle, "name", (gpointer *)&cfunc))
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
231 plug->name = (*cfunc)();
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
232 else
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
233 plug->name = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
235 if (g_module_symbol(plug->handle, "description", (gpointer *)&cfunc))
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
236 plug->description = (*cfunc)();
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
237 else
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
238 plug->description = NULL;
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
239
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
240 update_show_plugins();
153
8ed64c704fb0 [gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 142
diff changeset
241 save_prefs();
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
242 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
244 void show_plugins(GtkWidget *w, gpointer data)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
245 {
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
246 /* most of this code was shamelessly stolen from Glade */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
247 GtkWidget *mainvbox;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
248 GtkWidget *tophbox;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
249 GtkWidget *bothbox;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
250 GtkWidget *hbox;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
251 GtkWidget *vbox;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
252 GtkWidget *frame;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
253 GtkWidget *scrolledwindow;
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
254 GtkWidget *label;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
255 GtkWidget *add;
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
256 GtkWidget *close;
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
257
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
258 if (plugwindow)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
259 return;
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
260
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
261 plugwindow = gtk_window_new(GTK_WINDOW_DIALOG);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 885
diff changeset
262 gtk_window_set_wmclass(GTK_WINDOW(plugwindow), "plugins", "Gaim");
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
263 gtk_widget_realize(plugwindow);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
264 aol_icon(plugwindow->window);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
265 gtk_window_set_title(GTK_WINDOW(plugwindow), _("Gaim - Plugins"));
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
266 gtk_widget_set_usize(plugwindow, 515, 300);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
267 gtk_signal_connect(GTK_OBJECT(plugwindow), "destroy", GTK_SIGNAL_FUNC(hide_plugins), NULL);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
268
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
269 mainvbox = gtk_vbox_new(FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
270 gtk_container_add(GTK_CONTAINER(plugwindow), mainvbox);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
271 gtk_widget_show(mainvbox);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
272
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
273 /* Build the top */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
274 tophbox = gtk_hbox_new(FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
275 gtk_box_pack_start(GTK_BOX(mainvbox), tophbox, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
276 gtk_widget_show(tophbox);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
277
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
278 /* Left side: frame with list of plugin file names */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
279 frame = gtk_frame_new(_("Plugins"));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
280 gtk_box_pack_start(GTK_BOX(tophbox), frame, FALSE, FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
281 gtk_widget_set_usize(frame, 140, -1);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
282 gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
283 gtk_frame_set_label_align(GTK_FRAME(frame), 0.05, 0.5);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
284 gtk_widget_show(frame);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
285
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
286 scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
287 gtk_container_add(GTK_CONTAINER(frame), scrolledwindow);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
288 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
289 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
290 gtk_widget_show(scrolledwindow);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
291
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
292 pluglist = gtk_list_new();
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
293 gtk_list_set_selection_mode(GTK_LIST(pluglist), GTK_SELECTION_BROWSE);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
294 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwindow), pluglist);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
295 gtk_widget_show(pluglist);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
296
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
297 /* Right side: frame with description and the filepath of plugin */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
298 frame = gtk_frame_new(_("Description"));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
299 gtk_box_pack_start(GTK_BOX(tophbox), frame, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
300 gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
301 gtk_frame_set_label_align(GTK_FRAME(frame), 0.05, 0.5);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
302 gtk_widget_show(frame);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
303
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
304 vbox = gtk_vbox_new(FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
305 gtk_container_add(GTK_CONTAINER(frame), vbox);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
306 gtk_widget_show(vbox);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
307
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
308 scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
309 gtk_box_pack_start(GTK_BOX(vbox), scrolledwindow, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
310 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
311 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
312 gtk_widget_show(scrolledwindow);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
313
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
314 plugtext = gtk_text_new(NULL, NULL);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
315 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwindow), plugtext);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
316 gtk_text_set_word_wrap(GTK_TEXT(plugtext), TRUE);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
317 gtk_text_set_editable(GTK_TEXT(plugtext), FALSE);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
318 gtk_widget_show(plugtext);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
319
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
320 hbox = gtk_hbox_new(FALSE, 5);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
321 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
322 gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
323 gtk_widget_show(hbox);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
324
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
325 label = gtk_label_new(_("Filepath:"));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
326 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
327 gtk_widget_show(label);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
328
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
329 plugentry = gtk_entry_new();
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
330 gtk_box_pack_start(GTK_BOX(hbox), plugentry, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
331 gtk_entry_set_editable(GTK_ENTRY(plugentry), FALSE);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
332 gtk_widget_show(plugentry);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
333
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
334 /* Build the bottom button bar */
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
335 bothbox = gtk_hbox_new(TRUE, 10);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
336 gtk_box_pack_start(GTK_BOX(mainvbox), bothbox, FALSE, FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
337 gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
338 gtk_widget_show(bothbox);
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
339
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
340 if (!tooltips)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
341 tooltips = gtk_tooltips_new();
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
342
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
343 add = picture_button(plugwindow, _("Load"), gnome_add_xpm);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
344 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(load_file), NULL);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
345 gtk_box_pack_start(GTK_BOX(bothbox), add, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
346 gtk_tooltips_set_tip(tooltips, add, _("Load a plugin from a file"), "");
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
347
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
348 config = picture_button(plugwindow, _("Configure"), gnome_preferences_xpm);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
349 gtk_widget_set_sensitive(config, FALSE);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
350 gtk_box_pack_start(GTK_BOX(bothbox), config, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
351 gtk_tooltips_set_tip(tooltips, config, _("Configure settings of the selected plugin"), "");
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
352
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
353 reload = picture_button(plugwindow, _("Reload"), refresh_xpm);
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
354 gtk_widget_set_sensitive(reload, FALSE);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
355 gtk_signal_connect(GTK_OBJECT(reload), "clicked", GTK_SIGNAL_FUNC(plugin_reload_cb), NULL);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
356 gtk_box_pack_start(GTK_BOX(bothbox), reload, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
357 gtk_tooltips_set_tip(tooltips, reload, _("Reload the selected plugin"), "");
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
358
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
359 unload = picture_button(plugwindow, _("Unload"), gnome_remove_xpm);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
360 gtk_signal_connect(GTK_OBJECT(unload), "clicked", GTK_SIGNAL_FUNC(unload_plugin), pluglist);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
361 gtk_box_pack_start(GTK_BOX(bothbox), unload, TRUE, TRUE, 0);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
362 gtk_tooltips_set_tip(tooltips, unload, _("Unload the selected plugin"), "");
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
363
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
364 close = picture_button(plugwindow, _("Close"), cancel_xpm);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
365 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(hide_plugins), NULL);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
366 gtk_box_pack_start(GTK_BOX(bothbox), close, TRUE, TRUE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
367 gtk_tooltips_set_tip(tooltips, close, _("Close this window"), "");
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
368
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
369 update_show_plugins();
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
370 gtk_widget_show(plugwindow);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
371 }
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
372
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
373 static void update_show_plugins()
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
374 {
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
375 GList *plugs = plugins;
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
376 struct gaim_plugin *p;
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
377 GtkWidget *label;
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
378 GtkWidget *list_item;
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
379 GtkWidget *hbox;
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
380
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
381 if (plugwindow == NULL)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
382 return;
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
383
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
384 gtk_list_clear_items(GTK_LIST(pluglist), 0, -1);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
385 while (plugs) {
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
386 p = (struct gaim_plugin *)plugs->data;
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
387 label = gtk_label_new(plugin_makelistname(p->handle));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
388 hbox = gtk_hbox_new(FALSE, 0); /* for left justification */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
389 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
390
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
391 list_item = gtk_list_item_new();
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
392 gtk_container_add(GTK_CONTAINER(list_item), hbox);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
393 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(list_clicked), p);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
394 gtk_object_set_user_data(GTK_OBJECT(list_item), p);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
395
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
396 gtk_widget_show(hbox);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
397 gtk_widget_show(label);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
398 gtk_container_add(GTK_CONTAINER(pluglist), list_item);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
399 gtk_widget_show(list_item);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
400
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
401 plugs = g_list_next(plugs);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
402 }
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
403
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
404 /* Clear the display if nothing's selected */
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
405 if (GTK_LIST(pluglist)->selection == NULL) {
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
406 guint text_len = gtk_text_get_length(GTK_TEXT(plugtext));
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
407 gtk_text_set_point(GTK_TEXT(plugtext), 0);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
408 gtk_text_forward_delete(GTK_TEXT(plugtext), text_len);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
409 gtk_entry_set_text(GTK_ENTRY(plugentry), "");
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
410
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
411 gtk_widget_set_sensitive(config, FALSE);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
412 gtk_widget_set_sensitive(reload, FALSE);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
413 gtk_widget_set_sensitive(unload, FALSE);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
414 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
417 static void unload_plugin(GtkWidget *w, gpointer data)
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
418 {
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
419 GList *i;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
420 struct gaim_plugin *p;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
421 void (*gaim_plugin_remove)();
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
422
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
423 i = GTK_LIST(pluglist)->selection;
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
424
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
425 if (i == NULL)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
426 return;
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
427
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
428 p = gtk_object_get_user_data(GTK_OBJECT(i->data));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
430 /* Attempt to call the plugin's remove function (if there) */
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
431 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
432 (*gaim_plugin_remove)();
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
433
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
434 unload_immediate(p->handle);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
435 update_show_plugins();
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
436 }
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
437
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
438 static void unload_for_real(void *handle)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
439 {
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
440 GList *i;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
441 struct gaim_plugin *p = NULL;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
442
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
443 i = plugins;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
444 while (i) {
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
445 p = (struct gaim_plugin *)i->data;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
446 if (handle == p->handle)
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
447 break;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
448 p = NULL;
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
449 i = g_list_next(i);
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
450 }
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
451
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
452 if (!p)
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
453 return;
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
454
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
455 debug_printf("Unloading %s\n", g_module_name(p->handle));
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
456
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
457 plugin_remove_callbacks(p->handle);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
458
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
459 plugins = g_list_remove(plugins, p);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 970
diff changeset
460 g_free(p);
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
461 update_show_plugins();
154
1c4e47c0c5dd [gaim-migrate @ 164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 153
diff changeset
462 save_prefs();
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
463 }
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
464
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
465 static void unload_immediate(GModule *handle)
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
466 {
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
467 unload_for_real(handle);
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
468 g_module_close(handle);
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
469 }
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
470
2150
eb2cadb18479 [gaim-migrate @ 2160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
471 static gboolean unload_timeout(gpointer handle)
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
472 {
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
473 g_module_close(handle);
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
474 return FALSE;
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
475 }
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
476
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
477 void gaim_plugin_unload(GModule *handle)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
478 {
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
479 unload_for_real(handle);
2131
acc11216ec5d [gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2125
diff changeset
480 g_timeout_add(5000, unload_timeout, handle);
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
481 }
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
482
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
483 static void plugin_reload_cb(GtkWidget *w, gpointer data)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
484 {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
485 GList *i;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
486
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
487 i = GTK_LIST(pluglist)->selection;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
488 if (i == NULL)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
489 return;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
490
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
491 /* Just pass off plugin to the actual function */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
492 plugin_reload(gtk_object_get_user_data(GTK_OBJECT(i->data)));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
493 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
494
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
495 /* Do unload/load cycle of plugin. */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
496 static void plugin_reload(struct gaim_plugin *p)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
497 {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
498 char file[PATHSIZE];
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
499 void (*gaim_plugin_remove)();
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
500 GModule *handle = p->handle;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
501 struct gaim_plugin *plug;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
502 GList *plugs;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
503
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
504 strncpy(file, g_module_name(handle), sizeof(file));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
505 file[sizeof(file) - 1] = '\0';
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
506
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
507 debug_printf("Reloading %s\n", file);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
508
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
509 /* Unload */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
510 if (g_module_symbol(handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
511 (*gaim_plugin_remove)();
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
512 unload_immediate(handle);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
513
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
514 /* Load */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
515 load_plugin(file);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
516
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
517 /* Try and reselect the plugin in list */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
518 plugs = plugins;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
519 while (plugs) {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
520 plug = plugs->data;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
521 if (!strcmp(file, g_module_name(plug->handle))) {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
522 gtk_list_select_item(GTK_LIST(pluglist), g_list_index(plugins, plug));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
523 return;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
524 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
525 plugs = plugs->next;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
526 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
527 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
528
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
529 static void list_clicked(GtkWidget *w, struct gaim_plugin *p)
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
530 {
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
531 gchar *temp;
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
532 guint text_len;
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
533 void (*gaim_plugin_config)();
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
534
522
11cbf8b403b6 [gaim-migrate @ 532]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
535 if (confighandle != 0)
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 397
diff changeset
536 gtk_signal_disconnect(GTK_OBJECT(config), confighandle);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
537
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
538 text_len = gtk_text_get_length(GTK_TEXT(plugtext));
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
539 gtk_text_set_point(GTK_TEXT(plugtext), 0);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
540 gtk_text_forward_delete(GTK_TEXT(plugtext), text_len);
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
541
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
542 temp = g_strdup_printf("Name: %s\n\nDescription:\n%s",
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
543 (p->name != NULL) ? p->name : "",
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
544 (p->description != NULL) ? p->description : "");
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
545 gtk_text_insert(GTK_TEXT(plugtext), NULL, NULL, NULL, temp, -1);
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
546 g_free(temp);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
547 gtk_entry_set_text(GTK_ENTRY(plugentry), g_module_name(p->handle));
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
548
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
549 /* Find out if this plug-in has a configuration function */
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
550 if (g_module_symbol(p->handle, "gaim_plugin_config", (gpointer *)&gaim_plugin_config)) {
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 397
diff changeset
551 confighandle = gtk_signal_connect(GTK_OBJECT(config), "clicked",
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
552 GTK_SIGNAL_FUNC(gaim_plugin_config), NULL);
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
553 gtk_widget_set_sensitive(config, TRUE);
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
554 } else {
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 397
diff changeset
555 confighandle = 0;
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
556 gtk_widget_set_sensitive(config, FALSE);
110
f7c6366ca703 [gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
557 }
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
558
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
559 gtk_widget_set_sensitive(reload, TRUE);
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
560 gtk_widget_set_sensitive(unload, TRUE);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
561 }
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
562
2056
5028a07250c7 [gaim-migrate @ 2066]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1911
diff changeset
563 static void hide_plugins(GtkWidget *w, gpointer data)
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
564 {
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
565 if (plugwindow)
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
566 gtk_widget_destroy(plugwindow);
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
567 plugwindow = NULL;
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
568 config = NULL;
522
11cbf8b403b6 [gaim-migrate @ 532]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
569 confighandle = 0;
92
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
570 }
f3c6cf79f651 [gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
571
1911
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
572 static const gchar *plugin_makelistname(GModule *module)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
573 {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
574 static gchar filename[PATHSIZE];
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
575 gchar *filepath = g_module_name(module);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
576 char *cp;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
577
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
578 if (filepath == NULL || strlen(filepath) == 0)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
579 return NULL;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
580
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
581 if ((cp = strrchr(filepath, '/')) == NULL || *++cp == '\0')
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
582 cp = filepath;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
583
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
584 strncpy(filename, cp, sizeof(filename));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
585 filename[sizeof(filename) - 1] = '\0';
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
586
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
587 /* Try to pretty name by removing any trailing ".so" */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
588 if (strlen(filename) > 3 &&
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
589 strncmp(filename + strlen(filename) - 3, ".so", 3) == 0)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
590 filename[strlen(filename) - 3] = '\0';
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
591
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
592 return filename;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
593 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
594
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
595 /* Remove all callbacks associated with plugin handle */
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
596 static void plugin_remove_callbacks(GModule *handle)
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
597 {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
598 GList *c = callbacks;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
599 struct gaim_callback *g;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
600
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
601 debug_printf("%d callbacks to search\n", g_list_length(callbacks));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
602
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
603 while (c) {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
604 g = (struct gaim_callback *)c->data;
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
605 if (g->handle == handle) {
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
606 c = g_list_next(c);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
607 callbacks = g_list_remove(callbacks, (gpointer)g);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
608 debug_printf("Removing callback, %d remain\n", g_list_length(callbacks));
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
609 } else
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
610 c = g_list_next(c);
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
611 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
612 }
db3104dda736 [gaim-migrate @ 1921]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
613
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
614 void gaim_signal_connect(GModule *handle, enum gaim_event which, void *func, void *data)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
615 {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 970
diff changeset
616 struct gaim_callback *call = g_new0(struct gaim_callback, 1);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
617 call->handle = handle;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
618 call->event = which;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
619 call->function = func;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
620 call->data = data;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
621
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
622 callbacks = g_list_append(callbacks, call);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
623 debug_printf("Adding callback %d\n", g_list_length(callbacks));
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
624 }
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
625
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
626 void gaim_signal_disconnect(GModule *handle, enum gaim_event which, void *func)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
627 {
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
628 GList *c = callbacks;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
629 struct gaim_callback *g = NULL;
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
630
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
631 while (c) {
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
632 g = (struct gaim_callback *)c->data;
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
633 if (handle == g->handle && func == g->function) {
138
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
634 callbacks = g_list_remove(callbacks, c->data);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
635 g_free(g);
138
e8ea1e2fdf0c [gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 134
diff changeset
636 c = callbacks;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
637 if (c == NULL)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
638 break;
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
639 }
943
446d7d2cc909 [gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
640 c = g_list_next(c);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
641 }
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
642 }
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 92
diff changeset
643
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1
diff changeset
644 #endif /* GAIM_PLUGINS */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
645
797
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
646 char *event_name(enum gaim_event event)
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
647 {
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
648 static char buf[128];
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
649 switch (event) {
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
650 case event_signon:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
651 sprintf(buf, "event_signon");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
652 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
653 case event_signoff:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
654 sprintf(buf, "event_signoff");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
655 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
656 case event_away:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
657 sprintf(buf, "event_away");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
658 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
659 case event_back:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
660 sprintf(buf, "event_back");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
661 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
662 case event_im_recv:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
663 sprintf(buf, "event_im_recv");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
664 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
665 case event_im_send:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
666 sprintf(buf, "event_im_send");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
667 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
668 case event_buddy_signon:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
669 sprintf(buf, "event_buddy_signon");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
670 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
671 case event_buddy_signoff:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
672 sprintf(buf, "event_buddy_signoff");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
673 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
674 case event_buddy_away:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
675 sprintf(buf, "event_buddy_away");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
676 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
677 case event_buddy_back:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
678 sprintf(buf, "event_buddy_back");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
679 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
680 case event_buddy_idle:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
681 sprintf(buf, "event_buddy_idle");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
682 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
683 case event_buddy_unidle:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
684 sprintf(buf, "event_buddy_unidle");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
685 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
686 case event_blist_update:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
687 sprintf(buf, "event_blist_update");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
688 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
689 case event_chat_invited:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
690 sprintf(buf, "event_chat_invited");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
691 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
692 case event_chat_join:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
693 sprintf(buf, "event_chat_join");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
694 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
695 case event_chat_leave:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
696 sprintf(buf, "event_chat_leave");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
697 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
698 case event_chat_buddy_join:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
699 sprintf(buf, "event_chat_buddy_join");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
700 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
701 case event_chat_buddy_leave:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
702 sprintf(buf, "event_chat_buddy_leave");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
703 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
704 case event_chat_recv:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
705 sprintf(buf, "event_chat_recv");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
706 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
707 case event_chat_send:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
708 sprintf(buf, "event_chat_send");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
709 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
710 case event_warned:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
711 sprintf(buf, "event_warned");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
712 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
713 case event_error:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
714 sprintf(buf, "event_error");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
715 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
716 case event_quit:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
717 sprintf(buf, "event_quit");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
718 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
719 case event_new_conversation:
1745
c39cc2b44226 [gaim-migrate @ 1755]
Rob Flynn <gaim@robflynn.com>
parents: 1712
diff changeset
720 sprintf(buf, "event_new_conversation");
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
721 break;
1749
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
722 case event_set_info:
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
723 sprintf(buf, "event_set_info");
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
724 break;
1874
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
725 case event_draw_menu:
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
726 sprintf(buf, "event_draw_menu");
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
727 break;
2104
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
728 case event_im_displayed_sent:
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
729 sprintf(buf, "event_im_displayed_sent");
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
730 break;
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
731 case event_im_displayed_rcvd:
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
732 sprintf(buf, "event_im_displayed_rcvd");
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
733 break;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
734 default:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
735 sprintf(buf, "event_unknown");
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
736 break;
797
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
737 }
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
738 return buf;
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
739 }
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
740
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
741 int plugin_event(enum gaim_event event, void *arg1, void *arg2, void *arg3, void *arg4)
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
742 {
783
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
743 #ifdef USE_PERL
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
744 char buf[BUF_LONG];
797
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
745 char *tmp;
783
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
746 #endif
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
747 #ifdef GAIM_PLUGINS
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
748 GList *c = callbacks;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
749 struct gaim_callback *g;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
750
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
751 while (c) {
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
752 g = (struct gaim_callback *)c->data;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
753 if (g->event == event && g->function !=NULL) {
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
754 switch (event) {
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
755
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
756 /* struct gaim_connection * */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
757 case event_signon:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
758 case event_signoff:
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
759 {
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
760 void (*function) (struct gaim_connection *, void *) =
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
761 g->function;
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
762 (*function)(arg1, g->data);
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
763 }
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
764 break;
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
765
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
766 /* no args */
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
767 case event_blist_update:
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
768 case event_quit:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
769 {
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
770 void (*function)(void *) = g->function;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
771 (*function)(g->data);
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
772 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
773 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
774
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
775 /* struct gaim_connection *, char **, char **, guint32 */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
776 case event_im_recv:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
777 {
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
778 void (*function)(struct gaim_connection *, char **, char **,
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
779 guint32, void *) = g->function;
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
780 (*function)(arg1, arg2, arg3, (guint32)arg4, g->data);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
781 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
782 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
783
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
784 /* struct gaim_connection *, char *, char ** */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
785 case event_im_send:
2104
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
786 case event_im_displayed_sent:
783
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
787 case event_chat_send:
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
788 {
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
789 void (*function)(struct gaim_connection *, char *, char **,
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
790 void *) = g->function;
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
791 (*function)(arg1, arg2, arg3, g->data);
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
792 }
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
793 break;
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
794
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
795 /* struct gaim_connection *, char * */
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
796 case event_chat_join:
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
797 case event_chat_leave:
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
798 case event_buddy_signon:
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
799 case event_buddy_signoff:
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
800 case event_buddy_away:
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
801 case event_buddy_back:
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
802 case event_buddy_idle:
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
803 case event_buddy_unidle:
1749
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
804 case event_set_info:
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
805 {
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
806 void (*function)(struct gaim_connection *, char *, void *) =
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
807 g->function;
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
808 (*function)(arg1, arg2, g->data);
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
809 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
810 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
811
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
812 /* char * */
808
9d61f3d01046 [gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 806
diff changeset
813 case event_new_conversation:
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
814 {
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
815 void (*function)(char *, void *) = g->function;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
816 (*function)(arg1, g->data);
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
817 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
818 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
819
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
820 /* struct gaim_connection *, char *, char *, char * */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
821 case event_chat_invited:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
822 case event_chat_recv:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
823 {
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
824 void (*function)(struct gaim_connection *, char *, char *,
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
825 char *, void *) = g->function;
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
826 (*function)(arg1, arg2, arg3, arg4, g->data);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
827 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
828 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
829
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
830 /* struct gaim_connection *, char *, char * */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
831 case event_chat_buddy_join:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
832 case event_chat_buddy_leave:
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1252
diff changeset
833 case event_away:
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1252
diff changeset
834 case event_back:
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
835 {
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
836 void (*function)(struct gaim_connection *, char *, char *,
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
837 void *) = g->function;
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
838 (*function)(arg1, arg2, arg3, g->data);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
839 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
840 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
841
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
842 /* struct gaim_connection *, char *, char *, guint32 */
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
843 case event_im_displayed_rcvd:
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
844 {
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
845 void (*function)(struct gaim_connection *, char *, char *,
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
846 guint32, void *) = g->function;
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
847 (*function)(arg1, arg2, arg3, (guint32)arg4, g->data);
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
848 }
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
849 break;
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2150
diff changeset
850
1429
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
851 /* struct gaim_connection *, char *, int */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
852 case event_warned:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
853 {
1429
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
854 void (*function)(struct gaim_connection *, char *, int,
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
855 void *) = g->function;
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
856 (*function)(arg1, arg2, (int)arg3, g->data);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
857 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
858 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
859
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
860 /* int */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
861 case event_error:
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
862 {
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
863 void (*function)(int, void *) = g->function;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
864 (*function)((int)arg1, g->data);
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
865 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
866 break;
1874
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
867 /* GtkWidget *, char * */
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
868 case event_draw_menu:
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
869 {
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
870 void(*function)(GtkWidget *, char *) = g->function;
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
871 (*function)(arg1, arg2);
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
872 }
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
873 break;
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
874
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
875 default:
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
876 debug_printf("unknown event %d\n", event);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
877 break;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
878 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
879 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
880 c = c->next;
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
881 }
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
882 #endif /* GAIM_PLUGINS */
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
883 #ifdef USE_PERL
783
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
884 switch (event) {
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
885 case event_signon:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
886 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
887 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
888 case event_signoff:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
889 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
890 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
891 case event_away:
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1252
diff changeset
892 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
893 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
894 case event_back:
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1252
diff changeset
895 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
896 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
897 case event_im_recv:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
898 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s",
1712
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
899 ((struct gaim_connection *)arg1)->username,
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
900 *(char **)arg2 ? *(char **)arg2 : "(null)",
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
901 *(char **)arg3 ? *(char **)arg3 : "(null)");
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
902 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
903 case event_im_send:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
904 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s",
1712
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
905 ((struct gaim_connection *)arg1)->username, (char *)arg2,
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
906 *(char **)arg3 ? *(char **)arg3 : "(null)");
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
907 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
908 case event_buddy_signon:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
909 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
910 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
911 case event_buddy_signoff:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
912 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
913 break;
1749
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
914 case event_set_info:
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
915 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
5bfc58c20e82 [gaim-migrate @ 1759]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1745
diff changeset
916 break;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
917 case event_buddy_away:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
918 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
919 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
920 case event_buddy_back:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
921 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
922 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
923 case event_buddy_idle:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
924 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
925 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
926 case event_buddy_unidle:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
927 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
928 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
929 case event_blist_update:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
930 buf[0] = 0;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
931 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
932 case event_chat_invited:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
933 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", (char *)arg2, (char *)arg3,
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
934 (char *)arg4);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
935 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
936 case event_chat_join:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
937 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
938 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
939 case event_chat_leave:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
940 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
941 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
942 case event_chat_buddy_join:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
943 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\"", (char *)arg2, (char *)arg3);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
944 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
945 case event_chat_buddy_leave:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
946 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\"", (char *)arg2, (char *)arg3);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
947 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
948 case event_chat_recv:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
949 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", (char *)arg2, (char *)arg3,
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
950 (char *)arg4);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
951 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
952 case event_chat_send:
1712
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
953 g_snprintf(buf, sizeof buf, "\"%s\" %s", (char *)arg2,
560b3117aedf [gaim-migrate @ 1722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
954 *(char **)arg3 ? *(char **)arg3 : "(null)");
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
955 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
956 case event_warned:
1429
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
957 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %d",
865a6ead3258 [gaim-migrate @ 1439]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
958 ((struct gaim_connection *)arg1)->username, (char *)arg2, (int)arg3);
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
959 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
960 case event_error:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
961 g_snprintf(buf, sizeof buf, "%d", (int)arg1);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
962 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
963 case event_quit:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
964 buf[0] = 0;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
965 break;
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
966 case event_new_conversation:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
967 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1);
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
968 break;
1874
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
969 case event_draw_menu:
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
970 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2);
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1749
diff changeset
971 break;
2104
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
972 case event_im_displayed_sent:
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
973 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s",
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
974 ((struct gaim_connection *)arg1)->username, (char *)arg2,
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
975 *(char **)arg3 ? *(char **)arg3 : "(null)");
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
976 break;
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
977 case event_im_displayed_rcvd:
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
978 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s",
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
979 ((struct gaim_connection *)arg1)->username, (char *)arg2,
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
980 (char *)arg3 ? (char *)arg3 : "(null)");
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
981 break;
1252
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
982 default:
46c09828e929 [gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
983 break;
783
5bad8e4d1c88 [gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
984 }
797
c13e78ae0f86 [gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 789
diff changeset
985 tmp = event_name(event);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
986 debug_printf("%s: %s\n", tmp, buf);
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
987 return perl_event(tmp, buf);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
988 #else
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
989 return 0;
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
990 #endif
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 656
diff changeset
991 }
2125
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
992
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
993 /* Calls the gaim_plugin_remove function in any loaded plugin that has one */
2140
66a84ff0445a [gaim-migrate @ 2150]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2131
diff changeset
994 #ifdef GAIM_PLUGINS
2125
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
995 void remove_all_plugins()
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
996 {
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
997 GList *c = plugins;
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
998 struct gaim_plugin *p;
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
999 void (*gaim_plugin_remove)();
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1000
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1001 while (c) {
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1002 p = (struct gaim_plugin *)c->data;
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1003 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1004 (*gaim_plugin_remove)();
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1005 g_free(p);
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1006 c = c->next;
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1007 }
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
1008 }
2140
66a84ff0445a [gaim-migrate @ 2150]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2131
diff changeset
1009 #endif