Mercurial > pidgin
annotate src/plugins.c @ 293:101b3b4609d1
[gaim-migrate @ 303]
Here we go, 0.9.17 :-)
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Wed, 31 May 2000 22:48:49 +0000 |
parents | c99d0b82c8a8 |
children | b402a23f35df |
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 | |
90 | 31 #ifdef GAIM_PLUGINS |
32 | |
1 | 33 #include <string.h> |
34 #include <sys/time.h> | |
35 | |
36 #include <sys/types.h> | |
37 #include <sys/stat.h> | |
38 | |
39 #include <unistd.h> | |
40 #include <stdio.h> | |
41 #include <stdlib.h> | |
42 #include <gtk/gtk.h> | |
43 #include "gaim.h" | |
44 | |
90 | 45 #include <dlfcn.h> |
46 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
47 /* ------------------ Global Variables ----------------------- */ |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
48 |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
49 GList *plugins = NULL; |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
50 GList *callbacks = NULL; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
51 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
52 /* ------------------ Local Variables ------------------------ */ |
1 | 53 |
90 | 54 static GtkWidget *plugin_dialog = NULL; |
55 | |
56 static GtkWidget *pluglist; | |
57 static GtkWidget *plugtext; | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
58 static GtkWidget *plugwindow; |
1 | 59 |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
60 static GtkWidget *config; |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
61 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
62 /* --------------- Function Declarations --------------------- */ |
1 | 63 |
90 | 64 void show_plugins (GtkWidget *, gpointer); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
65 void load_plugin (char *); |
90 | 66 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
67 void gaim_signal_connect (void *, enum gaim_event, void *, void *); |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
68 void gaim_signal_disconnect(void *, enum gaim_event, void *); |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
69 |
90 | 70 static void destroy_plugins (GtkWidget *, gpointer); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
71 static void load_file (GtkWidget *, gpointer); |
90 | 72 static void load_which_plugin(GtkWidget *, gpointer); |
73 static void unload (GtkWidget *, gpointer); | |
74 static void list_clicked (GtkWidget *, struct gaim_plugin *); | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
75 static void update_show_plugins(); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
76 static void hide_plugins (GtkWidget *, gpointer); |
90 | 77 |
1 | 78 /* ------------------ Code Below ---------------------------- */ |
79 | |
90 | 80 static void destroy_plugins(GtkWidget *w, gpointer data) { |
81 if (plugin_dialog) | |
82 gtk_widget_destroy(plugin_dialog); | |
83 plugin_dialog = NULL; | |
84 } | |
85 | |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
86 static void load_file(GtkWidget *w, gpointer data) |
1 | 87 { |
90 | 88 char *buf = g_malloc(BUF_LEN); |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
89 FILE *fd; |
1 | 90 |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
91 if (plugin_dialog) { |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
92 g_free(buf); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
93 gtk_widget_show(plugin_dialog); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
94 gdk_window_raise(plugin_dialog->window); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
95 return; |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
96 } |
90 | 97 |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
98 plugin_dialog = gtk_file_selection_new("Gaim - Plugin List"); |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
99 |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
100 gtk_file_selection_hide_fileop_buttons( |
90 | 101 GTK_FILE_SELECTION(plugin_dialog)); |
102 | |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
103 g_snprintf(buf, BUF_LEN - 1, "%s/%s", getenv("HOME"), PLUGIN_DIR); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
104 fd = fopen(buf, "r"); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
105 if (!fd) |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
106 mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
107 else |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
108 fclose(fd); |
1 | 109 |
90 | 110 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
|
111 gtk_file_selection_complete(GTK_FILE_SELECTION(plugin_dialog), "*.so"); |
90 | 112 gtk_signal_connect(GTK_OBJECT(plugin_dialog), "destroy", |
113 GTK_SIGNAL_FUNC(destroy_plugins), plugin_dialog); | |
114 | |
115 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->ok_button), | |
116 "clicked", GTK_SIGNAL_FUNC(load_which_plugin), NULL); | |
117 | |
118 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(plugin_dialog)->cancel_button), | |
119 "clicked", GTK_SIGNAL_FUNC(destroy_plugins), NULL); | |
120 | |
121 g_free(buf); | |
122 gtk_widget_show(plugin_dialog); | |
123 gdk_window_raise(plugin_dialog->window); | |
124 } | |
1 | 125 |
139
c009c4f4ad02
[gaim-migrate @ 149]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
126 static void load_which_plugin(GtkWidget *w, gpointer data) { |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
127 load_plugin(gtk_file_selection_get_filename( |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
128 GTK_FILE_SELECTION(plugin_dialog))); |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
129 |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
130 if (plugin_dialog) |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
131 gtk_widget_destroy(plugin_dialog); |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
132 plugin_dialog = NULL; |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
133 } |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
134 |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
135 void load_plugin(char *filename) { |
90 | 136 struct gaim_plugin *plug; |
137 void (*gaim_plugin_init)(); | |
138 char *(*cfunc)(); | |
139 char *error; | |
140 | |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
141 if (filename == NULL) return; |
90 | 142 plug = g_malloc(sizeof *plug); |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
143 if (filename[0] != '/') { |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
144 char *buf = g_malloc(BUF_LEN); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
145 g_snprintf(buf, BUF_LEN - 1, "%s/%s", getenv("HOME"), PLUGIN_DIR); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
146 plug->filename = g_malloc(strlen(buf) + strlen(filename) + 1); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
147 sprintf(plug->filename, "%s%s", buf, filename); |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
148 } else |
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
149 plug->filename = g_strdup(filename); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
150 sprintf(debug_buff, "Loading %s\n", filename); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
151 debug_print(debug_buff); |
90 | 152 /* do NOT OR with RTLD_GLOBAL, otherwise plugins may conflict |
153 * (it's really just a way to work around other people's bad | |
154 * programming, by not using RTLD_GLOBAL :P ) */ | |
155 plug->handle = dlopen(plug->filename, RTLD_LAZY); | |
156 if (!plug->handle) { | |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
157 error = (char *)dlerror(); |
90 | 158 do_error_dialog(error, "Plugin Error"); |
159 g_free(plug); | |
160 return; | |
161 } | |
162 | |
163 gaim_plugin_init = dlsym(plug->handle, "gaim_plugin_init"); | |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
164 if ((error = (char *)dlerror()) != NULL) { |
90 | 165 do_error_dialog(error, "Plugin Error"); |
166 dlclose(plug->handle); | |
167 g_free(plug); | |
168 return; | |
169 } | |
170 | |
171 plugins = g_list_append(plugins, plug); | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
172 (*gaim_plugin_init)(plug->handle); |
1 | 173 |
90 | 174 cfunc = dlsym(plug->handle, "name"); |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
175 if ((error = (char *)dlerror()) == NULL) |
90 | 176 plug->name = (*cfunc)(); |
177 else | |
178 plug->name = NULL; | |
1 | 179 |
90 | 180 cfunc = dlsym(plug->handle, "description"); |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
181 if ((error = (char *)dlerror()) == NULL) |
90 | 182 plug->description = (*cfunc)(); |
183 else | |
184 plug->description = NULL; | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
185 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
186 update_show_plugins(); |
153
8ed64c704fb0
[gaim-migrate @ 163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
142
diff
changeset
|
187 save_prefs(); |
90 | 188 } |
1 | 189 |
90 | 190 void show_plugins(GtkWidget *w, gpointer data) { |
191 /* most of this code was shamelessly stolen from prefs.c */ | |
192 GtkWidget *page; | |
193 GtkWidget *topbox; | |
194 GtkWidget *botbox; | |
195 GtkWidget *sw; | |
196 GtkWidget *label; | |
197 GtkWidget *list_item; | |
198 GtkWidget *sw2; | |
199 GtkWidget *add; | |
200 GtkWidget *remove; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
201 GtkWidget *close; |
90 | 202 GList *plugs = plugins; |
203 struct gaim_plugin *p; | |
204 gchar buffer[1024]; | |
205 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
206 if (plugwindow) return; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
207 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
208 plugwindow = gtk_window_new(GTK_WINDOW_DIALOG); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
209 gtk_widget_realize(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
210 aol_icon(plugwindow->window); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
211 gtk_container_border_width(GTK_CONTAINER(plugwindow), 10); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
212 gtk_window_set_title(GTK_WINDOW(plugwindow), "Gaim - Plugins"); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
213 gtk_widget_set_usize(plugwindow, 400, 250); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
214 gtk_signal_connect(GTK_OBJECT(plugwindow), "destroy", |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
215 GTK_SIGNAL_FUNC(hide_plugins), NULL); |
90 | 216 |
217 page = gtk_vbox_new(FALSE, 0); | |
218 topbox = gtk_hbox_new(FALSE, 0); | |
219 botbox = gtk_hbox_new(FALSE, 0); | |
220 | |
221 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
222 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
223 GTK_POLICY_AUTOMATIC, | |
224 GTK_POLICY_AUTOMATIC); | |
225 | |
226 pluglist = gtk_list_new(); | |
227 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), pluglist); | |
228 gtk_box_pack_start(GTK_BOX(topbox), sw2, TRUE, TRUE, 0); | |
229 | |
230 sw = gtk_scrolled_window_new(NULL, NULL); | |
231 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
232 GTK_POLICY_AUTOMATIC, | |
233 GTK_POLICY_AUTOMATIC); | |
234 | |
235 plugtext = gtk_text_new(NULL, NULL); | |
236 gtk_container_add(GTK_CONTAINER(sw), plugtext); | |
237 gtk_box_pack_start(GTK_BOX(topbox), sw, TRUE, TRUE, 0); | |
238 gtk_text_set_word_wrap(GTK_TEXT(plugtext), TRUE); | |
239 gtk_text_set_editable(GTK_TEXT(plugtext), FALSE); | |
240 | |
241 add = gtk_button_new_with_label("Load Plugin"); | |
242 gtk_signal_connect(GTK_OBJECT(add), "clicked", | |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
139
diff
changeset
|
243 GTK_SIGNAL_FUNC(load_file), NULL); |
90 | 244 gtk_box_pack_start(GTK_BOX(botbox), add, TRUE, FALSE, 5); |
245 | |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
246 config = gtk_button_new_with_label("Configure Plugin"); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
247 gtk_widget_set_sensitive(config, 0); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
248 gtk_box_pack_start(GTK_BOX(botbox), config, TRUE, FALSE, 5); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
249 |
90 | 250 remove = gtk_button_new_with_label("Unload Plugin"); |
251 gtk_signal_connect(GTK_OBJECT(remove), "clicked", | |
252 GTK_SIGNAL_FUNC(unload), pluglist); | |
253 gtk_box_pack_start(GTK_BOX(botbox), remove, TRUE, FALSE, 5); | |
254 | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
255 close = gtk_button_new_with_label("Close"); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
256 gtk_signal_connect(GTK_OBJECT(close), "clicked", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
257 GTK_SIGNAL_FUNC(hide_plugins), NULL); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
258 gtk_box_pack_start(GTK_BOX(botbox), close, TRUE, FALSE, 5); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
259 |
90 | 260 gtk_box_pack_start(GTK_BOX(page), topbox, TRUE, TRUE, 0); |
261 gtk_box_pack_start(GTK_BOX(page), botbox, FALSE, FALSE, 0); | |
262 | |
263 if (plugs != NULL) { | |
264 p = (struct gaim_plugin *)plugs->data; | |
265 g_snprintf(buffer, sizeof(buffer), "%s", p->filename); | |
266 gtk_text_insert(GTK_TEXT(plugtext), NULL, NULL, NULL, buffer, -1); | |
267 } | |
268 | |
269 while (plugs) { | |
270 p = (struct gaim_plugin *)plugs->data; | |
271 label = gtk_label_new(p->filename); | |
272 list_item = gtk_list_item_new(); | |
273 gtk_container_add(GTK_CONTAINER(list_item), label); | |
274 gtk_signal_connect(GTK_OBJECT(list_item), "select", | |
275 GTK_SIGNAL_FUNC(list_clicked), p); | |
276 gtk_object_set_user_data(GTK_OBJECT(list_item), p); | |
277 | |
278 gtk_widget_show(label); | |
279 gtk_container_add(GTK_CONTAINER(pluglist), list_item); | |
280 gtk_widget_show(list_item); | |
281 | |
282 plugs = plugs->next; | |
283 } | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
284 if (plugins != NULL) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
285 gtk_list_select_item(GTK_LIST(pluglist), 0); |
90 | 286 |
287 gtk_widget_show(page); | |
288 gtk_widget_show(topbox); | |
289 gtk_widget_show(botbox); | |
290 gtk_widget_show(sw); | |
291 gtk_widget_show(sw2); | |
292 gtk_widget_show(pluglist); | |
293 gtk_widget_show(plugtext); | |
294 gtk_widget_show(add); | |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
295 gtk_widget_show(config); |
90 | 296 gtk_widget_show(remove); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
297 gtk_widget_show(close); |
90 | 298 |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
299 gtk_container_add(GTK_CONTAINER(plugwindow), page); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
300 gtk_widget_show(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
301 } |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
302 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
303 void update_show_plugins() { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
304 GList *plugs = plugins; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
305 struct gaim_plugin *p; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
306 GtkWidget *label; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
307 GtkWidget *list_item; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
308 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
309 if (pluglist == NULL) return; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
310 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
311 gtk_list_clear_items(GTK_LIST(pluglist), 0, -1); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
312 while (plugs) { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
313 p = (struct gaim_plugin *)plugs->data; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
314 label = gtk_label_new(p->filename); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
315 list_item = gtk_list_item_new(); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
316 gtk_container_add(GTK_CONTAINER(list_item), label); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
317 gtk_signal_connect(GTK_OBJECT(list_item), "select", |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
318 GTK_SIGNAL_FUNC(list_clicked), p); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
319 gtk_object_set_user_data(GTK_OBJECT(list_item), p); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
320 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
321 gtk_widget_show(label); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
322 gtk_container_add(GTK_CONTAINER(pluglist), list_item); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
323 gtk_widget_show(list_item); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
324 plugs = plugs->next; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
325 } |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
326 if (plugins != NULL) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
327 gtk_list_select_item(GTK_LIST(pluglist), 0); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
328 else { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
329 gtk_text_set_point(GTK_TEXT(plugtext), 0); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
330 gtk_text_forward_delete(GTK_TEXT(plugtext), |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
331 gtk_text_get_length(GTK_TEXT(plugtext))); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
332 } |
1 | 333 } |
334 | |
90 | 335 void unload(GtkWidget *w, gpointer data) { |
336 GList *i; | |
337 struct gaim_plugin *p; | |
338 void (*gaim_plugin_remove)(); | |
339 char *error; | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
340 GList *c = callbacks; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
341 struct gaim_callback *g; |
90 | 342 |
343 i = GTK_LIST(pluglist)->selection; | |
344 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
345 if (i == NULL) return; |
90 | 346 |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
347 p = gtk_object_get_user_data(GTK_OBJECT(i->data)); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
348 sprintf(debug_buff, "Unloading %s\n", p->filename); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
349 debug_print(debug_buff); |
1 | 350 |
90 | 351 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove"); |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
352 if ((error = (char *)dlerror()) == NULL) |
90 | 353 (*gaim_plugin_remove)(); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
354 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
|
355 debug_print(debug_buff); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
356 while (c) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
357 g = (struct gaim_callback *)c->data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
358 if (g->handle == p->handle) { |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
359 callbacks = g_list_remove(callbacks, c->data); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
360 g_free(g); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
361 sprintf(debug_buff, "Removing callback, %d remain\n", |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
362 g_list_length(callbacks)); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
363 debug_print(debug_buff); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
364 c = callbacks; |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
365 if (c == NULL) { |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
366 break; |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
367 } |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
368 } else { |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
369 c = c->next; |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
370 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
371 } |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
372 dlclose(p->handle); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
373 |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
374 plugins = g_list_remove(plugins, p); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
375 g_free(p->filename); |
90 | 376 g_free(p); |
134
00c1ee609648
[gaim-migrate @ 144]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
129
diff
changeset
|
377 gtk_widget_set_sensitive(config, 0); |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
378 update_show_plugins(); |
154
1c4e47c0c5dd
[gaim-migrate @ 164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
153
diff
changeset
|
379 save_prefs(); |
90 | 380 } |
381 | |
382 void list_clicked(GtkWidget *w, struct gaim_plugin *p) { | |
383 gchar buffer[2048]; | |
384 guint text_len; | |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
385 void (*gaim_plugin_config)(); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
386 char *error; |
90 | 387 |
388 text_len = gtk_text_get_length(GTK_TEXT(plugtext)); | |
389 gtk_text_set_point(GTK_TEXT(plugtext), 0); | |
390 gtk_text_forward_delete(GTK_TEXT(plugtext), text_len); | |
391 | |
392 g_snprintf(buffer, sizeof buffer, "%s\n%s", p->name, p->description); | |
393 gtk_text_insert(GTK_TEXT(plugtext), NULL, NULL, NULL, buffer, -1); | |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
394 |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
395 gaim_plugin_config = dlsym(p->handle, "gaim_plugin_config"); |
129
4290a5a20d3c
[gaim-migrate @ 139]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
110
diff
changeset
|
396 if ((error = (char *)dlerror()) == NULL) { |
110
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
397 gtk_signal_connect(GTK_OBJECT(config), "clicked", |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
398 GTK_SIGNAL_FUNC(gaim_plugin_config), NULL); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
399 gtk_widget_set_sensitive(config, 1); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
400 } else { |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
401 gtk_widget_set_sensitive(config, 0); |
f7c6366ca703
[gaim-migrate @ 120]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
402 } |
90 | 403 } |
404 | |
92
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
405 void hide_plugins(GtkWidget *w, gpointer data) { |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
406 if (plugwindow) |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
407 gtk_widget_destroy(plugwindow); |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
408 plugwindow = NULL; |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
409 } |
f3c6cf79f651
[gaim-migrate @ 102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
90
diff
changeset
|
410 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
411 void gaim_signal_connect(void *handle, enum gaim_event which, |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
412 void *func, void *data) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
413 struct gaim_callback *call = g_malloc(sizeof *call); |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
414 call->handle = handle; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
415 call->event = which; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
416 call->function = func; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
417 call->data = data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
418 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
419 callbacks = g_list_append(callbacks, call); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
420 sprintf(debug_buff, "Adding callback %d\n", g_list_length(callbacks)); |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
154
diff
changeset
|
421 debug_print(debug_buff); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
422 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
423 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
424 void gaim_signal_disconnect(void *handle, enum gaim_event which, void *func) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
425 GList *c = callbacks; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
426 struct gaim_callback *g = NULL; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
427 while (c) { |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
428 g = (struct gaim_callback *)c->data; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
429 if (handle == g->handle && func == g->function) { |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
430 callbacks = g_list_remove(callbacks, c->data); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
431 g_free(g); |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
432 c = callbacks; |
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
134
diff
changeset
|
433 if (c == NULL) break; |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
434 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
435 c = c->next; |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
436 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
437 } |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
92
diff
changeset
|
438 |
90 | 439 #endif /* GAIM_PLUGINS */ |