annotate src/gtkplugin.c @ 8805:6ad548495275

[gaim-migrate @ 9567] added committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 25 Apr 2004 13:54:49 +0000
parents fa6395637e2c
children 4a15962c344a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
6927
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
2 * @file gtkplugin.c GTK+ Plugins support
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
3 * @ingroup gtkui
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
9 * source distribution.
6927
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
10 *
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "gtkplugin.h"
5981
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
26 #include "debug.h"
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
27 #include "prefs.h"
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
28
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #include <string.h>
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 gaim_gtk_plugin_get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 GaimGtkPluginUiInfo *ui_info;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 g_return_val_if_fail(plugin != NULL, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 g_return_val_if_fail(GAIM_IS_GTK_PLUGIN(plugin), NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 if (plugin->info->ui_info == NULL)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 return NULL;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plugin);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 if (ui_info->get_config_frame == NULL)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 return NULL;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 return ui_info->get_config_frame(plugin);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 }
5981
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
49
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
50 void
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
51 gaim_gtk_plugins_save(void)
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
52 {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
53 GList *pl;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
54 GList *files = NULL;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
55 GaimPlugin *p;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
56
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
57 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
58 p = pl->data;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
59
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
60 if (p->info->type != GAIM_PLUGIN_PROTOCOL &&
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
61 p->info->type != GAIM_PLUGIN_LOADER) {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
62
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
63 files = g_list_append(files, p->path);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
64 }
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
65 }
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
66
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
67 gaim_prefs_set_string_list("/gaim/gtk/plugins/loaded", files);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
68 g_list_free(files);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
69 }