Sat, 08 Sep 2007 03:09:35 +0000
The FSF changed its address a while ago; our files were out of date.
This is a quick update done with a for loop, find, and sed.
| 5205 | 1 | /** |
| 2 | * @file plugin.h Plugin API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 15884 | 5 | * purple |
| 5205 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
5949
diff
changeset
|
10 | * |
| 5205 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18412
diff
changeset
|
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
18412
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
24 | * |
|
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
25 | * @see @ref plugin-signals |
|
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
26 | * @see @ref plugin-ids |
|
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
27 | * @see @ref plugin-i18n |
| 5205 | 28 | */ |
| 15884 | 29 | #ifndef _PURPLE_PLUGIN_H_ |
| 30 | #define _PURPLE_PLUGIN_H_ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
31 | |
|
8986
30ba617356bb
[gaim-migrate @ 9761]
Christopher O'Brien <siege@pidgin.im>
parents:
8814
diff
changeset
|
32 | #include <glib/glist.h> |
|
5224
8cb89f5b912a
[gaim-migrate @ 5594]
Herman Bloggs <herman@bluedigits.com>
parents:
5205
diff
changeset
|
33 | #include <gmodule.h> |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
34 | #include "signals.h" |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
35 | #include "value.h" |
| 5205 | 36 | |
| 15884 | 37 | typedef struct _PurplePlugin PurplePlugin; |
| 38 | typedef struct _PurplePluginInfo PurplePluginInfo; | |
| 39 | typedef struct _PurplePluginUiInfo PurplePluginUiInfo; | |
| 40 | typedef struct _PurplePluginLoaderInfo PurplePluginLoaderInfo; | |
| 5205 | 41 | |
| 15884 | 42 | typedef struct _PurplePluginAction PurplePluginAction; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
43 | |
| 15884 | 44 | typedef int PurplePluginPriority; /**< Plugin priority. */ |
| 5205 | 45 | |
| 8713 | 46 | #include "pluginpref.h" |
| 47 | ||
| 5205 | 48 | /** |
| 49 | * Plugin types. | |
| 50 | */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
51 | typedef enum |
| 5205 | 52 | { |
| 15884 | 53 | PURPLE_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ |
| 54 | PURPLE_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
| 55 | PURPLE_PLUGIN_LOADER, /**< Loader plugin. */ | |
| 56 | PURPLE_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
57 | |
| 15884 | 58 | } PurplePluginType; |
| 5205 | 59 | |
| 15884 | 60 | #define PURPLE_PRIORITY_DEFAULT 0 |
| 61 | #define PURPLE_PRIORITY_HIGHEST 9999 | |
| 62 | #define PURPLE_PRIORITY_LOWEST -9999 | |
| 5205 | 63 | |
| 15884 | 64 | #define PURPLE_PLUGIN_FLAG_INVISIBLE 0x01 |
|
6928
17e0c572bd97
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
65 | |
| 15884 | 66 | #define PURPLE_PLUGIN_MAGIC 5 /* once we hit 6.0.0 I think we can remove this */ |
|
8749
fb487e9e101a
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
67 | |
| 5205 | 68 | /** |
| 69 | * Detailed information about a plugin. | |
| 70 | * | |
| 71 | * This is used in the version 2.0 API and up. | |
| 72 | */ | |
| 12986 | 73 | /* TODO We need to figure out exactly what parts of this are required. The |
| 74 | * dependent plugin unloading stuff was causing crashes with perl and tcl | |
| 75 | * plugins because they didn't set ids and the dependency code was requiring | |
| 76 | * them. Then we need to actually make sure that plugins have all the right | |
| 77 | * parts before loading them. */ | |
| 15884 | 78 | struct _PurplePluginInfo |
| 5205 | 79 | { |
| 9943 | 80 | unsigned int magic; |
| 81 | unsigned int major_version; | |
| 82 | unsigned int minor_version; | |
| 15884 | 83 | PurplePluginType type; |
| 5205 | 84 | char *ui_requirement; |
| 85 | unsigned long flags; | |
| 86 | GList *dependencies; | |
| 15884 | 87 | PurplePluginPriority priority; |
| 5205 | 88 | |
| 89 | char *id; | |
| 90 | char *name; | |
| 91 | char *version; | |
| 92 | char *summary; | |
| 93 | char *description; | |
| 94 | char *author; | |
| 95 | char *homepage; | |
| 96 | ||
|
11963
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
97 | /** |
|
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
98 | * If a plugin defines a 'load' function, and it returns FALSE, |
|
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
99 | * then the plugin will not be loaded. |
|
10450
1757208151dc
[gaim-migrate @ 11715]
Mark Doliner <markdoliner@pidgin.im>
parents:
10448
diff
changeset
|
100 | */ |
| 15884 | 101 | gboolean (*load)(PurplePlugin *plugin); |
| 102 | gboolean (*unload)(PurplePlugin *plugin); | |
| 103 | void (*destroy)(PurplePlugin *plugin); | |
| 5205 | 104 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11772
diff
changeset
|
105 | void *ui_info; /**< Used only by UI-specific plugins to build a preference screen with a custom UI */ |
| 5205 | 106 | void *extra_info; |
| 15884 | 107 | PurplePluginUiInfo *prefs_info; /**< Used by any plugin to display preferences. If #ui_info has been specified, this will be ignored. */ |
| 108 | GList *(*actions)(PurplePlugin *plugin, gpointer context); | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
109 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
110 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
111 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
112 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
113 | void (*_purple_reserved4)(void); |
| 5205 | 114 | }; |
| 115 | ||
| 116 | /** | |
| 117 | * Extra information for loader plugins. | |
| 118 | */ | |
| 15884 | 119 | struct _PurplePluginLoaderInfo |
| 5205 | 120 | { |
| 121 | GList *exts; | |
| 122 | ||
| 15884 | 123 | gboolean (*probe)(PurplePlugin *plugin); |
| 124 | gboolean (*load)(PurplePlugin *plugin); | |
| 125 | gboolean (*unload)(PurplePlugin *plugin); | |
| 126 | void (*destroy)(PurplePlugin *plugin); | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
127 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
128 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
129 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
130 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
131 | void (*_purple_reserved4)(void); |
| 5205 | 132 | }; |
| 133 | ||
| 134 | /** | |
| 135 | * A plugin handle. | |
| 136 | */ | |
| 15884 | 137 | struct _PurplePlugin |
| 5205 | 138 | { |
| 139 | gboolean native_plugin; /**< Native C plugin. */ | |
| 140 | gboolean loaded; /**< The loaded state. */ | |
| 141 | void *handle; /**< The module handle. */ | |
| 142 | char *path; /**< The path to the plugin. */ | |
| 15884 | 143 | PurplePluginInfo *info; /**< The plugin information. */ |
| 5205 | 144 | char *error; |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
145 | void *ipc_data; /**< IPC data. */ |
| 5205 | 146 | void *extra; /**< Plugin-specific data. */ |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
147 | gboolean unloadable; /**< Unloadable */ |
| 12926 | 148 | GList *dependent_plugins; /**< Plugins depending on this */ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
149 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
150 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
151 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
152 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
153 | void (*_purple_reserved4)(void); |
| 5205 | 154 | }; |
| 155 | ||
| 15884 | 156 | #define PURPLE_PLUGIN_LOADER_INFO(plugin) \ |
| 157 | ((PurplePluginLoaderInfo *)(plugin)->info->extra_info) | |
| 5205 | 158 | |
| 15884 | 159 | struct _PurplePluginUiInfo { |
| 160 | PurplePluginPrefFrame *(*get_plugin_pref_frame)(PurplePlugin *plugin); | |
| 8713 | 161 | |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10710
diff
changeset
|
162 | int page_num; /**< Reserved */ |
| 15884 | 163 | PurplePluginPrefFrame *frame; /**< Reserved */ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
164 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
165 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
166 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
167 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
168 | void (*_purple_reserved4)(void); |
| 8713 | 169 | }; |
| 170 | ||
| 15884 | 171 | #define PURPLE_PLUGIN_HAS_PREF_FRAME(plugin) \ |
| 8713 | 172 | ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL) |
| 173 | ||
| 15884 | 174 | #define PURPLE_PLUGIN_UI_INFO(plugin) \ |
| 175 | ((PurplePluginUiInfo*)(plugin)->info->prefs_info) | |
| 8713 | 176 | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
177 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
178 | /** |
| 15884 | 179 | * The structure used in the actions member of PurplePluginInfo |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
180 | */ |
| 15884 | 181 | struct _PurplePluginAction { |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
182 | char *label; |
| 15884 | 183 | void (*callback)(PurplePluginAction *); |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
184 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
185 | /** set to the owning plugin */ |
| 15884 | 186 | PurplePlugin *plugin; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
187 | |
| 15884 | 188 | /** NULL for plugin actions menu, set to the PurpleConnection for |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
189 | account actions menu */ |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
190 | gpointer context; |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
191 | }; |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
192 | |
| 15884 | 193 | #define PURPLE_PLUGIN_HAS_ACTIONS(plugin) \ |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
194 | ((plugin)->info != NULL && (plugin)->info->actions != NULL) |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
195 | |
| 15884 | 196 | #define PURPLE_PLUGIN_ACTIONS(plugin, context) \ |
| 197 | (PURPLE_PLUGIN_HAS_ACTIONS(plugin)? \ | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
198 | (plugin)->info->actions(plugin, context): NULL) |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
199 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
200 | |
| 5205 | 201 | /** |
| 202 | * Handles the initialization of modules. | |
| 203 | */ | |
| 15884 | 204 | #if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) |
| 205 | # define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ | |
| 206 | gboolean purple_init_##pluginname##_plugin(void);\ | |
| 207 | gboolean purple_init_##pluginname##_plugin(void) { \ | |
| 208 | PurplePlugin *plugin = purple_plugin_new(TRUE, NULL); \ | |
| 5205 | 209 | plugin->info = &(plugininfo); \ |
| 210 | initfunc((plugin)); \ | |
| 15884 | 211 | purple_plugin_load((plugin)); \ |
| 212 | return purple_plugin_register(plugin); \ | |
| 5205 | 213 | } |
| 15884 | 214 | #else /* PURPLE_PLUGINS && !PURPLE_STATIC_PRPL */ |
| 215 | # define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ | |
| 216 | G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin); \ | |
| 217 | G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin) { \ | |
| 5205 | 218 | plugin->info = &(plugininfo); \ |
| 219 | initfunc((plugin)); \ | |
| 15884 | 220 | return purple_plugin_register(plugin); \ |
| 5205 | 221 | } |
| 222 | #endif | |
| 223 | ||
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
224 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
225 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
226 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
227 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
228 | |
| 5205 | 229 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
230 | /** @name Plugin API */ |
| 5205 | 231 | /**************************************************************************/ |
| 232 | /*@{*/ | |
| 233 | ||
| 234 | /** | |
| 235 | * Creates a new plugin structure. | |
| 236 | * | |
| 237 | * @param native Whether or not the plugin is native. | |
| 238 | * @param path The path to the plugin, or @c NULL if statically compiled. | |
| 239 | * | |
| 15884 | 240 | * @return A new PurplePlugin structure. |
| 5205 | 241 | */ |
| 15884 | 242 | PurplePlugin *purple_plugin_new(gboolean native, const char *path); |
| 5205 | 243 | |
| 244 | /** | |
| 245 | * Probes a plugin, retrieving the information on it and adding it to the | |
| 246 | * list of available plugins. | |
| 247 | * | |
| 248 | * @param filename The plugin's filename. | |
| 249 | * | |
| 250 | * @return The plugin handle. | |
| 251 | * | |
| 15884 | 252 | * @see purple_plugin_load() |
| 253 | * @see purple_plugin_destroy() | |
| 5205 | 254 | */ |
| 15884 | 255 | PurplePlugin *purple_plugin_probe(const char *filename); |
| 5205 | 256 | |
| 257 | /** | |
| 258 | * Registers a plugin and prepares it for loading. | |
| 259 | * | |
| 260 | * This shouldn't be called by anything but the internal module code. | |
| 15884 | 261 | * Plugins should use the PURPLE_INIT_PLUGIN() macro to register themselves |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
262 | * with the core. |
| 5205 | 263 | * |
| 264 | * @param plugin The plugin to register. | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
265 | * |
|
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
266 | * @return @c TRUE if the plugin was registered successfully. Otherwise |
|
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
267 | * @c FALSE is returned (this happens if the plugin does not contain |
|
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
268 | * the necessary information). |
| 5205 | 269 | */ |
| 15884 | 270 | gboolean purple_plugin_register(PurplePlugin *plugin); |
| 5205 | 271 | |
| 272 | /** | |
| 273 | * Attempts to load a previously probed plugin. | |
| 274 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6486
diff
changeset
|
275 | * @param plugin The plugin to load. |
| 5205 | 276 | * |
| 277 | * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 278 | * | |
| 15884 | 279 | * @see purple_plugin_reload() |
| 280 | * @see purple_plugin_unload() | |
| 5205 | 281 | */ |
| 15884 | 282 | gboolean purple_plugin_load(PurplePlugin *plugin); |
| 5205 | 283 | |
| 284 | /** | |
| 285 | * Unloads the specified plugin. | |
| 286 | * | |
| 287 | * @param plugin The plugin handle. | |
| 288 | * | |
| 289 | * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 290 | * | |
| 15884 | 291 | * @see purple_plugin_load() |
| 292 | * @see purple_plugin_reload() | |
| 5205 | 293 | */ |
| 15884 | 294 | gboolean purple_plugin_unload(PurplePlugin *plugin); |
| 5205 | 295 | |
| 296 | /** | |
| 297 | * Reloads a plugin. | |
| 298 | * | |
| 299 | * @param plugin The old plugin handle. | |
|
6486
18da8fdbc85b
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
300 | * |
| 5205 | 301 | * @return @c TRUE if successful, or @c FALSE otherwise. |
| 302 | * | |
| 15884 | 303 | * @see purple_plugin_load() |
| 304 | * @see purple_plugin_unload() | |
| 5205 | 305 | */ |
| 15884 | 306 | gboolean purple_plugin_reload(PurplePlugin *plugin); |
| 5205 | 307 | |
| 308 | /** | |
| 309 | * Unloads a plugin and destroys the structure from memory. | |
| 310 | * | |
| 311 | * @param plugin The plugin handle. | |
| 312 | */ | |
| 15884 | 313 | void purple_plugin_destroy(PurplePlugin *plugin); |
| 5205 | 314 | |
| 315 | /** | |
| 316 | * Returns whether or not a plugin is currently loaded. | |
| 317 | * | |
| 318 | * @param plugin The plugin. | |
| 319 | * | |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
320 | * @return @c TRUE if loaded, or @c FALSE otherwise. |
| 5205 | 321 | */ |
| 15884 | 322 | gboolean purple_plugin_is_loaded(const PurplePlugin *plugin); |
| 5205 | 323 | |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
324 | /** |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
325 | * Returns whether or not a plugin is unloadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
326 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
327 | * If this returns @c TRUE, the plugin is guaranteed to not |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
328 | * be loadable. However, a return value of @c FALSE does not |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
329 | * guarantee the plugin is loadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
330 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
331 | * @param plugin The plugin. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
332 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
333 | * @return @c TRUE if the plugin is known to be unloadable,\ |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
334 | * @c FALSE otherwise |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
335 | */ |
| 15884 | 336 | gboolean purple_plugin_is_unloadable(const PurplePlugin *plugin); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
337 | |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
338 | /** |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
339 | * Returns a plugin's id. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
340 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
341 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
342 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
343 | * @return The plugin's id. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
344 | */ |
| 15884 | 345 | const gchar *purple_plugin_get_id(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
346 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
347 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
348 | * Returns a plugin's name. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
349 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
350 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
351 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
352 | * @return THe name of the plugin, or @c NULL. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
353 | */ |
| 15884 | 354 | const gchar *purple_plugin_get_name(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
355 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
356 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
357 | * Returns a plugin's version. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
358 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
359 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
360 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
361 | * @return The plugin's version or @c NULL. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
362 | */ |
| 15884 | 363 | const gchar *purple_plugin_get_version(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
364 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
365 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
366 | * Returns a plugin's summary. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
367 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
368 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
369 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
370 | * @return The plugin's summary. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
371 | */ |
| 15884 | 372 | const gchar *purple_plugin_get_summary(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
373 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
374 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
375 | * Returns a plugin's description. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
376 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
377 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
378 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
379 | * @return The plugin's description. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
380 | */ |
| 15884 | 381 | const gchar *purple_plugin_get_description(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
382 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
383 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
384 | * Returns a plugin's author. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
385 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
386 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
387 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
388 | * @return The plugin's author. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
389 | */ |
| 15884 | 390 | const gchar *purple_plugin_get_author(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
391 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
392 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
393 | * Returns a plugin's homepage. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
394 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
395 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
396 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
397 | * @return The plugin's homepage. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
398 | */ |
| 15884 | 399 | const gchar *purple_plugin_get_homepage(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
400 | |
| 5205 | 401 | /*@}*/ |
| 402 | ||
| 403 | /**************************************************************************/ | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
404 | /** @name Plugin IPC API */ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
405 | /**************************************************************************/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
406 | /*@{*/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
407 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
408 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
409 | * Registers an IPC command in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
410 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
411 | * @param plugin The plugin to register the command with. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
412 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
413 | * @param func The function to execute. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
414 | * @param marshal The marshalling function. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
415 | * @param ret_value The return value type. |
|
7114
6e5e4e674496
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
7034
diff
changeset
|
416 | * @param num_params The number of parameters. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
417 | * @param ... The parameter types. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
418 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
419 | * @return TRUE if the function was registered successfully, or |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
420 | * FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
421 | */ |
| 15884 | 422 | gboolean purple_plugin_ipc_register(PurplePlugin *plugin, const char *command, |
| 423 | PurpleCallback func, | |
| 424 | PurpleSignalMarshalFunc marshal, | |
| 425 | PurpleValue *ret_value, int num_params, ...); | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
426 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
427 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
428 | * Unregisters an IPC command in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
429 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
430 | * @param plugin The plugin to unregister the command from. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
431 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
432 | */ |
| 15884 | 433 | void purple_plugin_ipc_unregister(PurplePlugin *plugin, const char *command); |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
434 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
435 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
436 | * Unregisters all IPC commands in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
437 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
438 | * @param plugin The plugin to unregister the commands from. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
439 | */ |
| 15884 | 440 | void purple_plugin_ipc_unregister_all(PurplePlugin *plugin); |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
441 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
442 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
443 | * Returns a list of value types used for an IPC command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
444 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
445 | * @param plugin The plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
446 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
447 | * @param ret_value The returned return value. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
448 | * @param num_params The returned number of parameters. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
449 | * @param params The returned list of parameters. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
450 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
451 | * @return TRUE if the command was found, or FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
452 | */ |
| 15884 | 453 | gboolean purple_plugin_ipc_get_params(PurplePlugin *plugin, const char *command, |
| 454 | PurpleValue **ret_value, int *num_params, | |
| 455 | PurpleValue ***params); | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
456 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
457 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
458 | * Executes an IPC command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
459 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
460 | * @param plugin The plugin to execute the command on. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
461 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
462 | * @param ok TRUE if the call was successful, or FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
463 | * @param ... The parameters to pass. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
464 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
465 | * @return The return value, which will be NULL if the command doesn't |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
466 | * return a value. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
467 | */ |
| 15884 | 468 | void *purple_plugin_ipc_call(PurplePlugin *plugin, const char *command, |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
469 | gboolean *ok, ...); |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
470 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
471 | /*@}*/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
472 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
473 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
474 | /** @name Plugins API */ |
| 5205 | 475 | /**************************************************************************/ |
| 476 | /*@{*/ | |
| 477 | ||
| 478 | /** | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
479 | * Add a new directory to search for plugins |
| 5205 | 480 | * |
|
10448
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
481 | * @param path The new search path. |
| 5205 | 482 | */ |
| 15884 | 483 | void purple_plugins_add_search_path(const char *path); |
| 5205 | 484 | |
| 485 | /** | |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
486 | * Unloads all loaded plugins. |
| 5205 | 487 | */ |
| 15884 | 488 | void purple_plugins_unload_all(void); |
| 5205 | 489 | |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
490 | /** |
|
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
491 | * Destroys all registered plugins. |
|
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
492 | */ |
| 15884 | 493 | void purple_plugins_destroy_all(void); |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
494 | |
| 5205 | 495 | /** |
| 15357 | 496 | * Saves the list of loaded plugins to the specified preference key |
| 497 | * | |
| 498 | * @param key The preference key to save the list of plugins to. | |
| 499 | */ | |
| 15884 | 500 | void purple_plugins_save_loaded(const char *key); |
| 15357 | 501 | |
| 502 | /** | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
503 | * Attempts to load all the plugins in the specified preference key |
| 15884 | 504 | * that were loaded when purple last quit. |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
505 | * |
|
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
506 | * @param key The preference key containing the list of plugins. |
| 5838 | 507 | */ |
| 15884 | 508 | void purple_plugins_load_saved(const char *key); |
| 5838 | 509 | |
| 510 | /** | |
| 5205 | 511 | * Probes for plugins in the registered module paths. |
| 512 | * | |
| 513 | * @param ext The extension type to probe for, or @c NULL for all. | |
| 514 | * | |
| 15884 | 515 | * @see purple_plugin_set_probe_path() |
| 5205 | 516 | */ |
| 15884 | 517 | void purple_plugins_probe(const char *ext); |
| 5205 | 518 | |
| 519 | /** | |
| 520 | * Returns whether or not plugin support is enabled. | |
| 521 | * | |
| 522 | * @return TRUE if plugin support is enabled, or FALSE otherwise. | |
| 523 | */ | |
| 15884 | 524 | gboolean purple_plugins_enabled(void); |
| 5205 | 525 | |
| 526 | /** | |
| 527 | * Registers a function that will be called when probing is finished. | |
| 528 | * | |
| 529 | * @param func The callback function. | |
| 530 | * @param data Data to pass to the callback. | |
| 531 | */ | |
| 15884 | 532 | void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data); |
| 5205 | 533 | |
| 534 | /** | |
| 535 | * Unregisters a function that would be called when probing is finished. | |
| 536 | * | |
| 537 | * @param func The callback function. | |
| 538 | */ | |
| 15884 | 539 | void purple_plugins_unregister_probe_notify_cb(void (*func)(void *)); |
| 5205 | 540 | |
| 541 | /** | |
| 542 | * Registers a function that will be called when a plugin is loaded. | |
| 543 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
544 | * @param func The callback function. |
| 5205 | 545 | * @param data Data to pass to the callback. |
| 546 | */ | |
| 15884 | 547 | void purple_plugins_register_load_notify_cb(void (*func)(PurplePlugin *, void *), |
| 5205 | 548 | void *data); |
| 549 | ||
| 550 | /** | |
| 551 | * Unregisters a function that would be called when a plugin is loaded. | |
| 552 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
553 | * @param func The callback function. |
| 5205 | 554 | */ |
| 15884 | 555 | void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *)); |
| 5205 | 556 | |
| 557 | /** | |
| 558 | * Registers a function that will be called when a plugin is unloaded. | |
| 559 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
560 | * @param func The callback function. |
| 5205 | 561 | * @param data Data to pass to the callback. |
| 562 | */ | |
| 15884 | 563 | void purple_plugins_register_unload_notify_cb(void (*func)(PurplePlugin *, void *), |
| 5205 | 564 | void *data); |
| 565 | ||
| 566 | /** | |
| 567 | * Unregisters a function that would be called when a plugin is unloaded. | |
| 568 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
569 | * @param func The callback function. |
| 5205 | 570 | */ |
| 15884 | 571 | void purple_plugins_unregister_unload_notify_cb(void (*func)(PurplePlugin *, |
| 5205 | 572 | void *)); |
| 573 | ||
| 574 | /** | |
| 575 | * Finds a plugin with the specified name. | |
| 576 | * | |
| 577 | * @param name The plugin name. | |
| 578 | * | |
| 579 | * @return The plugin if found, or @c NULL if not found. | |
| 580 | */ | |
| 15884 | 581 | PurplePlugin *purple_plugins_find_with_name(const char *name); |
| 5205 | 582 | |
| 583 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
584 | * Finds a plugin with the specified filename (filename with a path). |
| 5205 | 585 | * |
| 586 | * @param filename The plugin filename. | |
| 587 | * | |
| 588 | * @return The plugin if found, or @c NULL if not found. | |
| 589 | */ | |
| 15884 | 590 | PurplePlugin *purple_plugins_find_with_filename(const char *filename); |
| 5205 | 591 | |
| 592 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
593 | * Finds a plugin with the specified basename (filename without a path). |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
594 | * |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
595 | * @param basename The plugin basename. |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
596 | * |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
597 | * @return The plugin if found, or @c NULL if not found. |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
598 | */ |
| 15884 | 599 | PurplePlugin *purple_plugins_find_with_basename(const char *basename); |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
600 | |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
601 | /** |
| 5205 | 602 | * Finds a plugin with the specified plugin ID. |
| 603 | * | |
| 604 | * @param id The plugin ID. | |
| 605 | * | |
| 606 | * @return The plugin if found, or @c NULL if not found. | |
| 607 | */ | |
| 15884 | 608 | PurplePlugin *purple_plugins_find_with_id(const char *id); |
| 5205 | 609 | |
| 610 | /** | |
| 611 | * Returns a list of all loaded plugins. | |
| 612 | * | |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
613 | * @return A list of all loaded plugins. |
| 5205 | 614 | */ |
| 15884 | 615 | GList *purple_plugins_get_loaded(void); |
| 5205 | 616 | |
| 617 | /** | |
|
11950
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
618 | * Returns a list of all valid protocol plugins. A protocol |
|
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
619 | * plugin is considered invalid if it does not contain the call |
| 15884 | 620 | * to the PURPLE_INIT_PLUGIN() macro, or if it was compiled |
|
11950
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
621 | * against an incompatable API version. |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
622 | * |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
623 | * @return A list of all protocol plugins. |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
624 | */ |
| 15884 | 625 | GList *purple_plugins_get_protocols(void); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
626 | |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
627 | /** |
| 5205 | 628 | * Returns a list of all plugins, whether loaded or not. |
| 629 | * | |
| 630 | * @return A list of all plugins. | |
| 631 | */ | |
| 15884 | 632 | GList *purple_plugins_get_all(void); |
| 5205 | 633 | |
| 634 | /*@}*/ | |
| 635 | ||
| 10479 | 636 | /**************************************************************************/ |
| 637 | /** @name Plugins SubSytem API */ | |
| 638 | /**************************************************************************/ | |
| 639 | /*@{*/ | |
| 640 | ||
| 641 | /** | |
| 642 | * Returns the plugin subsystem handle. | |
| 643 | * | |
| 644 | * @return The plugin sybsystem handle. | |
| 645 | */ | |
| 15884 | 646 | void *purple_plugins_get_handle(void); |
| 10479 | 647 | |
| 648 | /** | |
| 649 | * Initializes the plugin subsystem | |
| 650 | */ | |
| 15884 | 651 | void purple_plugins_init(void); |
| 10479 | 652 | |
| 653 | /** | |
| 654 | * Uninitializes the plugin subsystem | |
| 655 | */ | |
| 15884 | 656 | void purple_plugins_uninit(void); |
| 10479 | 657 | |
| 658 | /*@}*/ | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
659 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
660 | /** |
| 15884 | 661 | * Allocates and returns a new PurplePluginAction. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
662 | * |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
663 | * @param label The description of the action to show to the user. |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
664 | * @param callback The callback to call when the user selects this action. |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
665 | */ |
| 15884 | 666 | PurplePluginAction *purple_plugin_action_new(const char* label, void (*callback)(PurplePluginAction *)); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
667 | |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
668 | /** |
| 15884 | 669 | * Frees a PurplePluginAction |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
670 | * |
| 15884 | 671 | * @param action The PurplePluginAction to free. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
672 | */ |
| 15884 | 673 | void purple_plugin_action_free(PurplePluginAction *action); |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
674 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
675 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
676 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
677 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
678 | |
| 15884 | 679 | #endif /* _PURPLE_PLUGIN_H_ */ |