Mercurial > pidgin
annotate src/plugins.c @ 1104:46c10fa4e557
[gaim-migrate @ 1114]
update the tooltip on signon
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 18 Nov 2000 02:17:07 +0000 |
parents | f168625b63fe |
children | cd96ca1aed02 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 * ---------------- | |
21 * The Plug-in plug | |
22 * | |
23 * Plugin support is currently being maintained by Mike Saraf | |
24 * msaraf@dwc.edu | |
25 * | |
90 | 26 * Well, I didn't see any work done on it for a while, so I'm going to try |
27 * my hand at it. - Eric warmenhoven@yahoo.com | |
28 * | |
1 | 29 */ |
30 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
176
diff
changeset
|
31 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
176
diff
changeset
|
32 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
176
diff
changeset
|
33 #endif |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
176
diff
changeset
|
34 |
1 | 35 #include <string.h> |
36 #include <sys/time.h> | |
37 | |
38 #include <sys/types.h> | |
39 #include <sys/stat.h> | |
40 | |
41 #include <unistd.h> | |
42 #include <stdio.h> | |
43 #include <stdlib.h> | |
44 #include <gtk/gtk.h> | |
45 #include "gaim.h" | |
46 | |
885
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
47 #ifdef GAIM_PLUGINS |
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
48 |
90 | 49 #include <dlfcn.h> |
50 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
51 /* ------------------ Global Variables ----------------------- */ |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
52 |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
53 GList *plugins = NULL; |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
54 GList *callbacks = NULL; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
55 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
56 /* ------------------ Local Variables ------------------------ */ |
1 | 57 |
90 | 58 static GtkWidget *plugin_dialog = NULL; |
59 | |
60 static GtkWidget *pluglist; | |
61 static GtkWidget *plugtext; | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
62 static GtkWidget *plugwindow; |
1 | 63 |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
64 static GtkWidget *config = NULL; |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
397
diff
changeset
|
65 static guint confighandle = 0; |
1025
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
66 static char *last_dir = NULL; |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
67 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
68 /* --------------- Function Declarations --------------------- */ |
1 | 69 |
90 | 70 void show_plugins (GtkWidget *, gpointer); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
71 void load_plugin (char *); |
90 | 72 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
73 void gaim_signal_connect (GModule *, enum gaim_event, void *, void *); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
74 void gaim_signal_disconnect(GModule *, enum gaim_event, void *); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
75 void gaim_plugin_unload (GModule *); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
76 |
90 | 77 static void destroy_plugins (GtkWidget *, gpointer); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
78 static void load_file (GtkWidget *, gpointer); |
90 | 79 static void load_which_plugin(GtkWidget *, gpointer); |
80 static void unload (GtkWidget *, gpointer); | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
81 static void unload_immediate (GModule *); |
90 | 82 static void list_clicked (GtkWidget *, struct gaim_plugin *); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
83 static void update_show_plugins(); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
84 static void hide_plugins (GtkWidget *, gpointer); |
90 | 85 |
1 | 86 /* ------------------ Code Below ---------------------------- */ |
87 | |
90 | 88 static void destroy_plugins(GtkWidget *w, gpointer data) { |
89 if (plugin_dialog) | |
90 gtk_widget_destroy(plugin_dialog); | |
91 plugin_dialog = NULL; | |
92 } | |
93 | |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
94 static void load_file(GtkWidget *w, gpointer data) |
1 | 95 { |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
96 gchar *buf; |
1 | 97 |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
98 if (plugin_dialog) { |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
99 gtk_widget_show(plugin_dialog); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
100 gdk_window_raise(plugin_dialog->window); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
101 return; |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
102 } |
90 | 103 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
104 plugin_dialog = gtk_file_selection_new(_("Gaim - Plugin List")); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
105 |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
106 gtk_file_selection_hide_fileop_buttons( |
90 | 107 GTK_FILE_SELECTION(plugin_dialog)); |
108 | |
1025
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
109 if (!last_dir) |
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
110 /* someone fix me please, how do we get the dir from configure? */ |
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
111 buf = g_strdup("/usr/local/lib/gaim/"); |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
112 else |
1025
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
113 buf = g_strconcat(last_dir, G_DIR_SEPARATOR_S, NULL); |
1 | 114 |
90 | 115 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
|
116 gtk_file_selection_complete(GTK_FILE_SELECTION(plugin_dialog), "*.so"); |
90 | 117 gtk_signal_connect(GTK_OBJECT(plugin_dialog), "destroy", |
118 GTK_SIGNAL_FUNC(destroy_plugins), plugin_dialog); | |
119 | |
120 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->ok_button), | |
121 "clicked", GTK_SIGNAL_FUNC(load_which_plugin), NULL); | |
122 | |
123 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->cancel_button), | |
124 "clicked", GTK_SIGNAL_FUNC(destroy_plugins), NULL); | |
125 | |
126 g_free(buf); | |
626
d86cc11faab8
[gaim-migrate @ 636]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
127 gtk_widget_show(plugin_dialog); |
90 | 128 gdk_window_raise(plugin_dialog->window); |
129 } | |
1 | 130 |
139
c009c4f4ad02
[gaim-migrate @ 149]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
131 static void load_which_plugin(GtkWidget *w, gpointer data) { |
1035
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
132 char *file; |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
133 |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
134 file = gtk_file_selection_get_filename( |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
135 GTK_FILE_SELECTION(plugin_dialog)); |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
136 if (file_is_dir(file, plugin_dialog)) { |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
137 return; |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
138 } |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
139 |
80a47e3b1bca
[gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1025
diff
changeset
|
140 load_plugin(file); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
141 |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
142 if (plugin_dialog) |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
143 gtk_widget_destroy(plugin_dialog); |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
144 plugin_dialog = NULL; |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
145 } |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
146 |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
147 void load_plugin(char *filename) { |
90 | 148 struct gaim_plugin *plug; |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
149 GList *c = plugins; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
150 char *(*gaim_plugin_init)(GModule *); |
90 | 151 char *(*cfunc)(); |
152 char *error; | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
153 char *retval; |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
154 char *tmp_filename; |
90 | 155 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
156 if (!g_module_supported()) return; |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
157 if (filename == NULL) return; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
158 |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
159 while (c) { |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
160 plug = (struct gaim_plugin *)c->data; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
161 if (!strcmp(filename, g_module_name(plug->handle))) { |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
162 void (*gaim_plugin_remove)(); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
163 if (g_module_symbol(plug->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
164 (*gaim_plugin_remove)(); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
165 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
166 unload_immediate(plug->handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
167 c = plugins; |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
168 } else |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
169 c = g_list_next(c); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
170 } |
90 | 171 plug = g_malloc(sizeof *plug); |
944
2f64424bf319
[gaim-migrate @ 954]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
943
diff
changeset
|
172 if (!g_path_is_absolute(filename)) |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
173 tmp_filename = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S, |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
174 PLUGIN_DIR, filename, NULL); |
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
175 else |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
176 tmp_filename = g_strdup(filename); |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
177 |
1025
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
178 if (last_dir) |
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
179 g_free(last_dir); |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
180 last_dir = g_dirname(tmp_filename); |
1025
84a5d80e52f1
[gaim-migrate @ 1035]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
181 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
182 debug_printf("Loading %s\n", tmp_filename); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
183 plug->handle = g_module_open(tmp_filename, 0); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
184 g_free(tmp_filename); |
90 | 185 if (!plug->handle) { |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
186 error = (char *)g_module_error(); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
187 do_error_dialog(error, _("Plugin Error")); |
90 | 188 g_free(plug); |
189 return; | |
190 } | |
191 | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
192 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
|
193 do_error_dialog(g_module_error(), _("Plugin Error")); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
194 g_module_close(plug->handle); |
90 | 195 g_free(plug); |
196 return; | |
197 } | |
198 | |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
199 retval = (*gaim_plugin_init)(plug->handle); |
970 | 200 debug_printf("loaded plugin returned %d\n", retval); |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
201 if (retval) { |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
202 GList *c = callbacks; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
203 struct gaim_callback *g; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
204 while (c) { |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
205 g = (struct gaim_callback *)c->data; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
206 if (g->handle == plug->handle) { |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
207 callbacks = g_list_remove(callbacks, c->data); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
208 sprintf(debug_buff, "Removing callback, %d remain\n", |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
209 g_list_length(callbacks)); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
210 debug_print(debug_buff); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
211 c = callbacks; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
212 if (c == NULL) { |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
213 break; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
214 } |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
215 } else { |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
216 c = g_list_next(c); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
217 } |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
218 } |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
219 do_error_dialog(retval, _("Plugin Error")); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
220 g_module_close(plug->handle); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
221 g_free(plug); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
222 return; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
223 } |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
224 |
90 | 225 plugins = g_list_append(plugins, plug); |
1 | 226 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
227 if (g_module_symbol(plug->handle, "name", (gpointer *)&cfunc)) |
90 | 228 plug->name = (*cfunc)(); |
229 else | |
230 plug->name = NULL; | |
1 | 231 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
232 if (g_module_symbol(plug->handle, "description", (gpointer *)&cfunc)) |
90 | 233 plug->description = (*cfunc)(); |
234 else | |
235 plug->description = NULL; | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
236 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
237 update_show_plugins(); |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
238 save_prefs(); |
90 | 239 } |
1 | 240 |
90 | 241 void show_plugins(GtkWidget *w, gpointer data) { |
242 /* most of this code was shamelessly stolen from prefs.c */ | |
243 GtkWidget *page; | |
244 GtkWidget *topbox; | |
245 GtkWidget *botbox; | |
246 GtkWidget *sw; | |
247 GtkWidget *label; | |
248 GtkWidget *list_item; | |
249 GtkWidget *sw2; | |
250 GtkWidget *add; | |
251 GtkWidget *remove; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
252 GtkWidget *close; |
90 | 253 GList *plugs = plugins; |
254 struct gaim_plugin *p; | |
255 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
256 if (plugwindow) return; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
257 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
258 plugwindow = gtk_window_new(GTK_WINDOW_DIALOG); |
905 | 259 gtk_window_set_wmclass(GTK_WINDOW(plugwindow), "plugins", "Gaim"); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
260 gtk_widget_realize(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
261 aol_icon(plugwindow->window); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
262 gtk_container_border_width(GTK_CONTAINER(plugwindow), 10); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
263 gtk_window_set_title(GTK_WINDOW(plugwindow), _("Gaim - Plugins")); |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
264 gtk_widget_set_usize(plugwindow, 400, 250); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
265 gtk_signal_connect(GTK_OBJECT(plugwindow), "destroy", |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
266 GTK_SIGNAL_FUNC(hide_plugins), NULL); |
90 | 267 |
268 page = gtk_vbox_new(FALSE, 0); | |
269 topbox = gtk_hbox_new(FALSE, 0); | |
270 botbox = gtk_hbox_new(FALSE, 0); | |
271 | |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
272 /* Left side: list of plugin file names */ |
90 | 273 sw2 = gtk_scrolled_window_new(NULL, NULL); |
274 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
275 GTK_POLICY_AUTOMATIC, | |
276 GTK_POLICY_AUTOMATIC); | |
277 | |
278 pluglist = gtk_list_new(); | |
279 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), pluglist); | |
280 gtk_box_pack_start(GTK_BOX(topbox), sw2, TRUE, TRUE, 0); | |
281 | |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
282 /* Right side: the text description of the plugin */ |
90 | 283 sw = gtk_scrolled_window_new(NULL, NULL); |
284 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
285 GTK_POLICY_AUTOMATIC, | |
286 GTK_POLICY_AUTOMATIC); | |
287 | |
288 plugtext = gtk_text_new(NULL, NULL); | |
289 gtk_container_add(GTK_CONTAINER(sw), plugtext); | |
290 gtk_box_pack_start(GTK_BOX(topbox), sw, TRUE, TRUE, 0); | |
291 gtk_text_set_word_wrap(GTK_TEXT(plugtext), TRUE); | |
292 gtk_text_set_editable(GTK_TEXT(plugtext), FALSE); | |
293 | |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
294 /* Build the bottom button bar */ |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
295 add = gtk_button_new_with_label(_("Load Plugin")); |
90 | 296 gtk_signal_connect(GTK_OBJECT(add), "clicked", |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
297 GTK_SIGNAL_FUNC(load_file), NULL); |
90 | 298 gtk_box_pack_start(GTK_BOX(botbox), add, TRUE, FALSE, 5); |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
299 if (display_options & OPT_DISP_COOL_LOOK) |
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
300 gtk_button_set_relief(GTK_BUTTON(add), GTK_RELIEF_NONE); |
90 | 301 |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
302 config = gtk_button_new_with_label(_("Configure Plugin")); |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
303 gtk_widget_set_sensitive(config, 0); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
304 gtk_box_pack_start(GTK_BOX(botbox), config, TRUE, FALSE, 5); |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
305 if (display_options & OPT_DISP_COOL_LOOK) |
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
306 gtk_button_set_relief(GTK_BUTTON(config), GTK_RELIEF_NONE); |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
307 |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
308 remove = gtk_button_new_with_label(_("Unload Plugin")); |
90 | 309 gtk_signal_connect(GTK_OBJECT(remove), "clicked", |
310 GTK_SIGNAL_FUNC(unload), pluglist); | |
311 gtk_box_pack_start(GTK_BOX(botbox), remove, TRUE, FALSE, 5); | |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
312 if (display_options & OPT_DISP_COOL_LOOK) |
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
313 gtk_button_set_relief(GTK_BUTTON(remove), GTK_RELIEF_NONE); |
90 | 314 |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
315 close = gtk_button_new_with_label(_("Close")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
316 gtk_signal_connect(GTK_OBJECT(close), "clicked", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
317 GTK_SIGNAL_FUNC(hide_plugins), NULL); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
318 gtk_box_pack_start(GTK_BOX(botbox), close, TRUE, FALSE, 5); |
656
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
319 if (display_options & OPT_DISP_COOL_LOOK) |
732ee4f6f541
[gaim-migrate @ 666]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
626
diff
changeset
|
320 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); |
619 | 321 |
90 | 322 gtk_box_pack_start(GTK_BOX(page), topbox, TRUE, TRUE, 0); |
323 gtk_box_pack_start(GTK_BOX(page), botbox, FALSE, FALSE, 0); | |
324 | |
325 while (plugs) { | |
326 p = (struct gaim_plugin *)plugs->data; | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
327 label = gtk_label_new(g_module_name(p->handle)); |
90 | 328 list_item = gtk_list_item_new(); |
329 gtk_container_add(GTK_CONTAINER(list_item), label); | |
330 gtk_signal_connect(GTK_OBJECT(list_item), "select", | |
331 GTK_SIGNAL_FUNC(list_clicked), p); | |
332 gtk_object_set_user_data(GTK_OBJECT(list_item), p); | |
333 | |
334 gtk_widget_show(label); | |
335 gtk_container_add(GTK_CONTAINER(pluglist), list_item); | |
336 gtk_widget_show(list_item); | |
337 | |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
338 plugs = g_list_next(plugs); |
90 | 339 } |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
340 |
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
341 /* Make the first item selected */ |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
342 if (plugins != NULL) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
343 gtk_list_select_item(GTK_LIST(pluglist), 0); |
90 | 344 |
345 gtk_widget_show(page); | |
346 gtk_widget_show(topbox); | |
347 gtk_widget_show(botbox); | |
348 gtk_widget_show(sw); | |
349 gtk_widget_show(sw2); | |
350 gtk_widget_show(pluglist); | |
351 gtk_widget_show(plugtext); | |
352 gtk_widget_show(add); | |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
353 gtk_widget_show(config); |
90 | 354 gtk_widget_show(remove); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
355 gtk_widget_show(close); |
90 | 356 |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
357 gtk_container_add(GTK_CONTAINER(plugwindow), page); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
358 gtk_widget_show(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
359 } |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
360 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
361 void update_show_plugins() { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
362 GList *plugs = plugins; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
363 struct gaim_plugin *p; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
364 GtkWidget *label; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
365 GtkWidget *list_item; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
366 |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
367 if (plugwindow == NULL) return; |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
368 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
369 gtk_list_clear_items(GTK_LIST(pluglist), 0, -1); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
370 while (plugs) { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
371 p = (struct gaim_plugin *)plugs->data; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
372 label = gtk_label_new(g_module_name(p->handle)); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
373 list_item = gtk_list_item_new(); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
374 gtk_container_add(GTK_CONTAINER(list_item), label); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
375 gtk_signal_connect(GTK_OBJECT(list_item), "select", |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
376 GTK_SIGNAL_FUNC(list_clicked), p); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
377 gtk_object_set_user_data(GTK_OBJECT(list_item), p); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
378 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
379 gtk_widget_show(label); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
380 gtk_container_add(GTK_CONTAINER(pluglist), list_item); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
381 gtk_widget_show(list_item); |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
382 plugs = g_list_next(plugs); |
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 if (plugins != NULL) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
385 gtk_list_select_item(GTK_LIST(pluglist), 0); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
386 else { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
387 gtk_text_set_point(GTK_TEXT(plugtext), 0); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
388 gtk_text_forward_delete(GTK_TEXT(plugtext), |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
389 gtk_text_get_length(GTK_TEXT(plugtext))); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
390 } |
1 | 391 } |
392 | |
90 | 393 void unload(GtkWidget *w, gpointer data) { |
394 GList *i; | |
395 struct gaim_plugin *p; | |
396 void (*gaim_plugin_remove)(); | |
397 | |
398 i = GTK_LIST(pluglist)->selection; | |
399 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
400 if (i == NULL) return; |
90 | 401 |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
402 p = gtk_object_get_user_data(GTK_OBJECT(i->data)); |
1 | 403 |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
404 /* Attempt to call the plugin's remove function (if there) */ |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
405 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) |
90 | 406 (*gaim_plugin_remove)(); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
407 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
408 unload_immediate(p->handle); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
409 } |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
410 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
411 static void unload_for_real(void *handle) { |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
412 GList *i; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
413 struct gaim_plugin *p = NULL; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
414 GList *c = callbacks; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
415 struct gaim_callback *g; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
416 |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
417 i = plugins; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
418 while (i) { |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
419 p = (struct gaim_plugin *)i->data; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
420 if (handle == p->handle) |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
421 break; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
422 p = NULL; |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
423 i = g_list_next(i); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
424 } |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
425 |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
426 if (!p) |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
427 return; |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
428 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
429 sprintf(debug_buff, "Unloading %s\n", g_module_name(p->handle)); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
430 debug_print(debug_buff); |
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
431 |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
432 sprintf(debug_buff, "%d callbacks to search\n", g_list_length(callbacks)); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
433 debug_print(debug_buff); |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
434 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
435 while (c) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
436 g = (struct gaim_callback *)c->data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
437 if (g->handle == p->handle) { |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
438 callbacks = g_list_remove(callbacks, c->data); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
439 g_free(g); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
440 sprintf(debug_buff, "Removing callback, %d remain\n", |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
441 g_list_length(callbacks)); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
442 debug_print(debug_buff); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
443 c = callbacks; |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
444 if (c == NULL) { |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
445 break; |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
446 } |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
447 } else { |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
448 c = g_list_next(c); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
449 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
450 } |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
451 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
452 plugins = g_list_remove(plugins, p); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
970
diff
changeset
|
453 g_free(p); |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
454 if (config) gtk_widget_set_sensitive(config, 0); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
455 update_show_plugins(); |
154
1c4e47c0c5dd
[gaim-migrate @ 164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
153
diff
changeset
|
456 save_prefs(); |
90 | 457 } |
458 | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
459 void unload_immediate(GModule *handle) { |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
460 unload_for_real(handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
461 g_module_close(handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
462 } |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
463 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
464 static gint unload_timeout(GModule *handle) { |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
465 g_module_close(handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
466 return FALSE; |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
467 } |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
468 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
469 void gaim_plugin_unload(GModule *handle) { |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
470 unload_for_real(handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
471 gtk_timeout_add(5000, (GtkFunction)unload_timeout, handle); |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
472 } |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
473 |
90 | 474 void list_clicked(GtkWidget *w, struct gaim_plugin *p) { |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
475 gchar *temp; |
90 | 476 guint text_len; |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
477 void (*gaim_plugin_config)(); |
90 | 478 |
522
11cbf8b403b6
[gaim-migrate @ 532]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
479 if (confighandle != 0) |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
397
diff
changeset
|
480 gtk_signal_disconnect(GTK_OBJECT(config), confighandle); |
90 | 481 text_len = gtk_text_get_length(GTK_TEXT(plugtext)); |
482 gtk_text_set_point(GTK_TEXT(plugtext), 0); | |
483 gtk_text_forward_delete(GTK_TEXT(plugtext), text_len); | |
484 | |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
485 temp = g_strdup_printf("%s\n%s", p->name, p->description); |
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
486 gtk_text_insert(GTK_TEXT(plugtext), NULL, NULL, NULL, temp, -1); |
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
487 g_free(temp); |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
488 |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
489 /* Find out if this plug-in has a configuration function */ |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
490 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
|
491 confighandle = gtk_signal_connect(GTK_OBJECT(config), "clicked", |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
492 GTK_SIGNAL_FUNC(gaim_plugin_config), NULL); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
493 gtk_widget_set_sensitive(config, 1); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
494 } else { |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
397
diff
changeset
|
495 confighandle = 0; |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
496 gtk_widget_set_sensitive(config, 0); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
497 } |
90 | 498 } |
499 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
500 void hide_plugins(GtkWidget *w, gpointer data) { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
501 if (plugwindow) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
502 gtk_widget_destroy(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
503 plugwindow = NULL; |
425
ae7c762775cd
[gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
403
diff
changeset
|
504 config = NULL; |
522
11cbf8b403b6
[gaim-migrate @ 532]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
425
diff
changeset
|
505 confighandle = 0; |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
506 } |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
507 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
508 void gaim_signal_connect(GModule *handle, enum gaim_event which, |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
509 void *func, void *data) { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
970
diff
changeset
|
510 struct gaim_callback *call = g_new0(struct gaim_callback, 1); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
511 call->handle = handle; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
512 call->event = which; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
513 call->function = func; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
514 call->data = data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
515 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
516 callbacks = g_list_append(callbacks, call); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
517 sprintf(debug_buff, "Adding callback %d\n", g_list_length(callbacks)); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
518 debug_print(debug_buff); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
519 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
520 |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
521 void gaim_signal_disconnect(GModule *handle, enum gaim_event which, void *func) { |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
522 GList *c = callbacks; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
523 struct gaim_callback *g = NULL; |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
524 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
525 while (c) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
526 g = (struct gaim_callback *)c->data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
527 if (handle == g->handle && func == g->function) { |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
528 callbacks = g_list_remove(callbacks, c->data); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
529 g_free(g); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
530 c = callbacks; |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
531 if (c == NULL) break; |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
532 } |
943
446d7d2cc909
[gaim-migrate @ 953]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
533 c = g_list_next(c); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
534 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
535 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
536 |
90 | 537 #endif /* GAIM_PLUGINS */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
538 |
797
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
539 char *event_name(enum gaim_event event) |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
540 { |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
541 static char buf[128]; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
542 switch(event) { |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
543 case event_signon: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
544 sprintf(buf, "event_signon"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
545 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
546 case event_signoff: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
547 sprintf(buf, "event_signoff"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
548 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
549 case event_away: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
550 sprintf(buf, "event_away"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
551 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
552 case event_back: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
553 sprintf(buf, "event_back"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
554 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
555 case event_im_recv: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
556 sprintf(buf, "event_im_recv"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
557 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
558 case event_im_send: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
559 sprintf(buf, "event_im_send"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
560 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
561 case event_buddy_signon: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
562 sprintf(buf, "event_buddy_signon"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
563 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
564 case event_buddy_signoff: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
565 sprintf(buf, "event_buddy_signoff"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
566 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
567 case event_buddy_away: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
568 sprintf(buf, "event_buddy_away"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
569 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
570 case event_buddy_back: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
571 sprintf(buf, "event_buddy_back"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
572 break; |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
573 case event_buddy_idle: |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
574 sprintf(buf, "event_buddy_idle"); |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
575 break; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
576 case event_buddy_unidle: |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
577 sprintf(buf, "event_buddy_unidle"); |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
578 break; |
1058
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
579 case event_blist_update: |
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
580 sprintf(buf, "event_blist_update"); |
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
581 break; |
797
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
582 case event_chat_invited: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
583 sprintf(buf, "event_chat_invited"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
584 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
585 case event_chat_join: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
586 sprintf(buf, "event_chat_join"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
587 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
588 case event_chat_leave: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
589 sprintf(buf, "event_chat_leave"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
590 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
591 case event_chat_buddy_join: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
592 sprintf(buf, "event_chat_buddy_join"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
593 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
594 case event_chat_buddy_leave: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
595 sprintf(buf, "event_chat_buddy_leave"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
596 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
597 case event_chat_recv: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
598 sprintf(buf, "event_chat_recv"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
599 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
600 case event_chat_send: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
601 sprintf(buf, "event_chat_send"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
602 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
603 case event_warned: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
604 sprintf(buf, "event_warned"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
605 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
606 case event_error: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
607 sprintf(buf, "event_error"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
608 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
609 case event_quit: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
610 sprintf(buf, "event_quit"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
611 break; |
808
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
612 case event_new_conversation: |
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
613 sprintf(buf, "event_new_conversaion"); |
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
614 break; |
797
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
615 default: |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
616 sprintf(buf, "event_unknown"); |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
617 break; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
618 } |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
619 return buf; |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
620 } |
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
621 |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
622 int plugin_event(enum gaim_event event, void *arg1, void *arg2, void *arg3, void *arg4) { |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
623 #ifdef USE_PERL |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
624 char buf[BUF_LONG]; |
797
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
625 char *tmp; |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
626 #endif |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
627 #ifdef GAIM_PLUGINS |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
628 GList *c = callbacks; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
629 struct gaim_callback *g; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
630 |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
631 while (c) { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
632 g = (struct gaim_callback *)c->data; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
633 if (g->event == event && g->function != NULL) { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
634 switch(event) { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
635 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
636 /* struct gaim_connection * */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
637 case event_signon: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
638 case event_signoff: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
639 { |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
640 void (*function)(struct gaim_connection *, void *) = g->function; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
641 (*function)(arg1, g->data); |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
642 } |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
643 break; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
644 |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
645 /* no args */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
646 case event_away: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
647 case event_back: |
1058
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
648 case event_blist_update: |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
649 case event_quit: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
650 { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
651 void (*function)(void *) = g->function; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
652 (*function)(g->data); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
653 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
654 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
655 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
656 /* struct gaim_connection *, char **, char ** */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
657 case event_im_recv: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
658 { |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
659 void (*function)(struct gaim_connection *, char **, char **, |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
660 void *) = g->function; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
661 (*function)(arg1, arg2, arg3, g->data); |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
662 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
663 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
664 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
665 /* struct gaim_connection *, char *, char ** */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
666 case event_im_send: |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
667 case event_chat_send: |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
668 { |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
669 void (*function)(struct gaim_connection *, char *, char **, |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
670 void *) = g->function; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
671 (*function)(arg1, arg2, arg3, g->data); |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
672 } |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
673 break; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
674 |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
675 /* struct gaim_connection *, char * */ |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
676 case event_chat_join: |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
677 case event_chat_leave: |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
678 case event_buddy_signon: |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
679 case event_buddy_signoff: |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
680 case event_buddy_away: |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
681 case event_buddy_back: |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
682 case event_buddy_idle: |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
683 case event_buddy_unidle: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
684 { |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
685 void (*function)(struct gaim_connection *, char *, void *) = |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
686 g->function; |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
687 (*function)(arg1, arg2, g->data); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
688 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
689 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
690 |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
691 /* char * */ |
808
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
692 case event_new_conversation: |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
693 { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
694 void (*function)(char *, void *) = g->function; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
695 (*function)(arg1, g->data); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
696 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
697 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
698 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
699 /* struct gaim_connection *, char *, char *, char * */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
700 case event_chat_invited: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
701 case event_chat_recv: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
702 { |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
703 void (*function)(struct gaim_connection *, char *, char *, |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
704 char *, void *) = g->function; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
705 (*function)(arg1, arg2, arg3, arg4, g->data); |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
706 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
707 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
708 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
709 /* struct gaim_connection *, char *, char * */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
710 case event_chat_buddy_join: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
711 case event_chat_buddy_leave: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
712 { |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
713 void (*function)(struct gaim_connection *, char *, char *, |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
714 void *) = g->function; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
715 (*function)(arg1, arg2, arg3, g->data); |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
716 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
717 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
718 |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
719 /* char *, int */ |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
720 case event_warned: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
721 { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
722 void (*function)(char *, int, void *) = g->function; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
723 (*function)(arg1, (int)arg2, g->data); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
724 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
725 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
726 |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
727 /* int */ |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
728 case event_error: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
729 { |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
730 void (*function)(int, void *) = g->function; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
731 (*function)((int)arg1, g->data); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
732 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
733 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
734 |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
735 default: |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
736 sprintf(debug_buff, "unknown event %d\n", event); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
737 debug_print(debug_buff); |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
738 break; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
739 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
740 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
741 c = c->next; |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
742 } |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
743 #endif /* GAIM_PLUGINS */ |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
744 #ifdef USE_PERL |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
745 switch (event) { |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
746 case event_signon: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
747 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
748 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
749 case event_signoff: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
750 g_snprintf(buf, sizeof buf, "\"%s\"", ((struct gaim_connection *)arg1)->username); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
751 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
752 case event_away: |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
753 buf[0] = 0; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
754 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
755 case event_back: |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
756 buf[0] = 0; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
757 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
758 case event_im_recv: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
759 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", ((struct gaim_connection *)arg1)->username, *(char **)arg2, *(char **)arg3); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
760 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
761 case event_im_send: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
762 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", ((struct gaim_connection *)arg1)->username, (char *)arg2, *(char **)arg3); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
763 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
764 case event_buddy_signon: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
765 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
766 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
767 case event_buddy_signoff: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
768 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
769 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
770 case event_buddy_away: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
771 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
772 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
773 case event_buddy_back: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
774 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
775 break; |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
776 case event_buddy_idle: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
777 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
778 break; |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
779 case event_buddy_unidle: |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
780 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
781 break; |
1058
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
782 case event_blist_update: |
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
783 buf[0] = 0; |
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1057
diff
changeset
|
784 break; |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
785 case event_chat_invited: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
786 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", (char *)arg2, (char *)arg3, (char *)arg4); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
787 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
788 case event_chat_join: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
789 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
790 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
791 case event_chat_leave: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
792 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
793 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
794 case event_chat_buddy_join: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
795 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\"", (char *)arg2, (char *)arg3); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
796 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
797 case event_chat_buddy_leave: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
798 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\"", (char *)arg2, (char *)arg3); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
799 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
800 case event_chat_recv: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
801 g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", (char *)arg2, (char *)arg3, (char *)arg4); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
802 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
803 case event_chat_send: |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
804 g_snprintf(buf, sizeof buf, "\"%s\" %s", (char *)arg2, *(char **)arg3); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
805 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
806 case event_warned: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
807 g_snprintf(buf, sizeof buf, "\"%s\" %d", (char *)arg1, (int)arg2); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
808 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
809 case event_error: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
810 g_snprintf(buf, sizeof buf, "%d", (int)arg1); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
811 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
812 case event_quit: |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
813 buf[0] = 0; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
814 break; |
808
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
815 case event_new_conversation: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
816 g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1); |
808
9d61f3d01046
[gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
817 break; |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
818 default: |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
819 break; |
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
820 } |
797
c13e78ae0f86
[gaim-migrate @ 807]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
789
diff
changeset
|
821 tmp = event_name(event); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
822 g_snprintf(debug_buff, sizeof debug_buff, "%s: %s\n", tmp, buf); |
783
5bad8e4d1c88
[gaim-migrate @ 793]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
823 debug_print(debug_buff); |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
824 return perl_event(tmp, buf); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
825 #else |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
826 return 0; |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
827 #endif |
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
656
diff
changeset
|
828 } |