Mercurial > pidgin
annotate src/plugin.h @ 13159:d03013fd39bf
[gaim-migrate @ 15522]
Fix the filename unescaping.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Tue, 07 Feb 2006 16:02:25 +0000 |
| parents | a0a4b44239e8 |
| children | f0577a01b2cf |
| rev | line source |
|---|---|
| 5205 | 1 /** |
| 2 * @file plugin.h Plugin API | |
| 3 * @ingroup core | |
| 4 * | |
| 5 * gaim | |
| 6 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
|
6485
70d5122bc3ff
[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 | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
| 25 #ifndef _GAIM_PLUGIN_H_ | |
| 26 #define _GAIM_PLUGIN_H_ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
27 |
| 8986 | 28 #include <glib/glist.h> |
|
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5205
diff
changeset
|
29 #include <gmodule.h> |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
30 #include "signals.h" |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
31 #include "value.h" |
| 5205 | 32 |
|
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
33 typedef struct _GaimPlugin GaimPlugin; |
|
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
34 typedef struct _GaimPluginInfo GaimPluginInfo; |
|
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
35 typedef struct _GaimPluginUiInfo GaimPluginUiInfo; |
| 5205 | 36 typedef struct _GaimPluginLoaderInfo GaimPluginLoaderInfo; |
| 37 | |
| 9015 | 38 typedef struct _GaimPluginAction GaimPluginAction; |
| 39 | |
| 5205 | 40 typedef int GaimPluginPriority; /**< Plugin priority. */ |
| 41 | |
| 8713 | 42 #include "pluginpref.h" |
| 43 | |
| 5205 | 44 /** |
| 45 * Plugin types. | |
| 46 */ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
47 typedef enum |
| 5205 | 48 { |
| 49 GAIM_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ | |
| 50 GAIM_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
| 51 GAIM_PLUGIN_LOADER, /**< Loader plugin. */ | |
| 52 GAIM_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
53 |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
54 } GaimPluginType; |
| 5205 | 55 |
| 56 #define GAIM_PRIORITY_DEFAULT 0 | |
| 57 #define GAIM_PRIORITY_HIGHEST 9999 | |
| 58 #define GAIM_PRIORITY_LOWEST -9999 | |
| 59 | |
|
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
60 #define GAIM_PLUGIN_FLAG_INVISIBLE 0x01 |
|
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
61 |
| 9946 | 62 #define GAIM_PLUGIN_MAGIC 5 /* once we hit 6.0.0 I think we can remove this */ |
|
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
63 |
| 5205 | 64 /** |
| 65 * Detailed information about a plugin. | |
| 66 * | |
| 67 * This is used in the version 2.0 API and up. | |
| 68 */ | |
|
12986
4e9935a539db
[gaim-migrate @ 15339]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12926
diff
changeset
|
69 /* TODO We need to figure out exactly what parts of this are required. The |
|
4e9935a539db
[gaim-migrate @ 15339]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12926
diff
changeset
|
70 * dependent plugin unloading stuff was causing crashes with perl and tcl |
|
4e9935a539db
[gaim-migrate @ 15339]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12926
diff
changeset
|
71 * plugins because they didn't set ids and the dependency code was requiring |
|
4e9935a539db
[gaim-migrate @ 15339]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12926
diff
changeset
|
72 * them. Then we need to actually make sure that plugins have all the right |
|
4e9935a539db
[gaim-migrate @ 15339]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12926
diff
changeset
|
73 * parts before loading them. */ |
| 5205 | 74 struct _GaimPluginInfo |
| 75 { | |
| 9943 | 76 unsigned int magic; |
| 77 unsigned int major_version; | |
| 78 unsigned int minor_version; | |
| 5205 | 79 GaimPluginType type; |
| 80 char *ui_requirement; | |
| 81 unsigned long flags; | |
| 82 GList *dependencies; | |
| 83 GaimPluginPriority priority; | |
| 84 | |
| 85 char *id; | |
| 86 char *name; | |
| 87 char *version; | |
| 88 char *summary; | |
| 89 char *description; | |
| 90 char *author; | |
| 91 char *homepage; | |
| 92 | |
| 11963 | 93 /** |
| 94 * If a plugin defines a 'load' function, and it returns FALSE, | |
| 95 * then the plugin will not be loaded. | |
| 10450 | 96 */ |
| 5205 | 97 gboolean (*load)(GaimPlugin *plugin); |
| 98 gboolean (*unload)(GaimPlugin *plugin); | |
| 99 void (*destroy)(GaimPlugin *plugin); | |
| 100 | |
|
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11772
diff
changeset
|
101 void *ui_info; /**< Used only by UI-specific plugins to build a preference screen with a custom UI */ |
| 5205 | 102 void *extra_info; |
|
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11772
diff
changeset
|
103 GaimPluginUiInfo *prefs_info; /**< Used by any plugin to display preferences. If #ui_info has been specified, this will be ignored. */ |
| 9015 | 104 GList *(*actions)(GaimPlugin *plugin, gpointer context); |
| 5205 | 105 }; |
| 106 | |
| 107 /** | |
| 108 * Extra information for loader plugins. | |
| 109 */ | |
| 110 struct _GaimPluginLoaderInfo | |
| 111 { | |
| 112 GList *exts; | |
| 113 | |
| 114 gboolean (*probe)(GaimPlugin *plugin); | |
| 115 gboolean (*load)(GaimPlugin *plugin); | |
| 116 gboolean (*unload)(GaimPlugin *plugin); | |
| 117 void (*destroy)(GaimPlugin *plugin); | |
| 118 }; | |
| 119 | |
| 120 /** | |
| 121 * A plugin handle. | |
| 122 */ | |
| 123 struct _GaimPlugin | |
| 124 { | |
| 125 gboolean native_plugin; /**< Native C plugin. */ | |
| 126 gboolean loaded; /**< The loaded state. */ | |
| 127 void *handle; /**< The module handle. */ | |
| 128 char *path; /**< The path to the plugin. */ | |
| 129 GaimPluginInfo *info; /**< The plugin information. */ | |
| 130 char *error; | |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
131 void *ipc_data; /**< IPC data. */ |
| 5205 | 132 void *extra; /**< Plugin-specific data. */ |
|
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
133 gboolean unloadable; /**< Unloadable */ |
|
12926
2c4f20ff387c
[gaim-migrate @ 15279]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
134 GList *dependent_plugins; /**< Plugins depending on this */ |
| 5205 | 135 }; |
| 136 | |
| 137 #define GAIM_PLUGIN_LOADER_INFO(plugin) \ | |
| 138 ((GaimPluginLoaderInfo *)(plugin)->info->extra_info) | |
| 139 | |
| 8713 | 140 struct _GaimPluginUiInfo { |
| 141 GaimPluginPrefFrame *(*get_plugin_pref_frame)(GaimPlugin *plugin); | |
| 142 | |
| 10759 | 143 int page_num; /**< Reserved */ |
| 8814 | 144 GaimPluginPrefFrame *frame; /**< Reserved */ |
| 8713 | 145 }; |
| 146 | |
| 147 #define GAIM_PLUGIN_HAS_PREF_FRAME(plugin) \ | |
| 148 ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL) | |
| 149 | |
| 150 #define GAIM_PLUGIN_UI_INFO(plugin) \ | |
| 151 ((GaimPluginUiInfo*)(plugin)->info->prefs_info) | |
| 152 | |
| 9015 | 153 |
| 154 /** | |
| 155 * The structure used in the actions member of GaimPluginInfo | |
| 156 */ | |
| 157 struct _GaimPluginAction { | |
| 158 char *label; | |
| 159 void (*callback)(GaimPluginAction *); | |
| 160 | |
| 161 /** set to the owning plugin */ | |
| 162 GaimPlugin *plugin; | |
| 163 | |
| 164 /** NULL for plugin actions menu, set to the GaimConnection for | |
| 165 account actions menu */ | |
| 166 gpointer context; | |
| 167 }; | |
| 168 | |
| 169 #define GAIM_PLUGIN_HAS_ACTIONS(plugin) \ | |
| 170 ((plugin)->info != NULL && (plugin)->info->actions != NULL) | |
| 171 | |
| 172 #define GAIM_PLUGIN_ACTIONS(plugin, context) \ | |
| 173 (GAIM_PLUGIN_HAS_ACTIONS(plugin)? \ | |
| 174 (plugin)->info->actions(plugin, context): NULL) | |
| 175 | |
| 176 | |
| 5205 | 177 /** |
| 178 * Handles the initialization of modules. | |
| 179 */ | |
| 8082 | 180 #if !defined(GAIM_PLUGINS) || defined(GAIM_STATIC_PRPL) |
| 5205 | 181 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
|
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
182 gboolean gaim_init_##pluginname##_plugin(void);\ |
| 5205 | 183 gboolean gaim_init_##pluginname##_plugin(void) { \ |
| 184 GaimPlugin *plugin = gaim_plugin_new(TRUE, NULL); \ | |
| 185 plugin->info = &(plugininfo); \ | |
| 186 initfunc((plugin)); \ | |
| 187 return gaim_plugin_register(plugin); \ | |
| 188 } | |
| 8082 | 189 #else /* GAIM_PLUGINS && !GAIM_STATIC_PRPL */ |
| 5205 | 190 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
|
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
191 G_MODULE_EXPORT gboolean gaim_init_plugin(GaimPlugin *plugin); \ |
|
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5205
diff
changeset
|
192 G_MODULE_EXPORT gboolean gaim_init_plugin(GaimPlugin *plugin) { \ |
| 5205 | 193 plugin->info = &(plugininfo); \ |
| 194 initfunc((plugin)); \ | |
| 195 return gaim_plugin_register(plugin); \ | |
| 196 } | |
| 197 #endif | |
| 198 | |
| 9015 | 199 |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
200 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
201 extern "C" { |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
202 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
203 |
| 5205 | 204 /**************************************************************************/ |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
205 /** @name Plugin API */ |
| 5205 | 206 /**************************************************************************/ |
| 207 /*@{*/ | |
| 208 | |
| 209 /** | |
| 210 * Creates a new plugin structure. | |
| 211 * | |
| 212 * @param native Whether or not the plugin is native. | |
| 213 * @param path The path to the plugin, or @c NULL if statically compiled. | |
| 214 * | |
| 215 * @return A new GaimPlugin structure. | |
| 216 */ | |
| 217 GaimPlugin *gaim_plugin_new(gboolean native, const char *path); | |
| 218 | |
| 219 /** | |
| 220 * Probes a plugin, retrieving the information on it and adding it to the | |
| 221 * list of available plugins. | |
| 222 * | |
| 223 * @param filename The plugin's filename. | |
| 224 * | |
| 225 * @return The plugin handle. | |
| 226 * | |
| 227 * @see gaim_plugin_load() | |
| 228 * @see gaim_plugin_destroy() | |
| 229 */ | |
| 230 GaimPlugin *gaim_plugin_probe(const char *filename); | |
| 231 | |
| 232 /** | |
| 233 * Registers a plugin and prepares it for loading. | |
| 234 * | |
| 235 * This shouldn't be called by anything but the internal module code. | |
| 10447 | 236 * Plugins should use the GAIM_INIT_PLUGIN() macro to register themselves |
| 237 * with the core. | |
| 5205 | 238 * |
| 239 * @param plugin The plugin to register. | |
| 10447 | 240 * |
| 241 * @return @c TRUE if the plugin was registered successfully. Otherwise | |
| 242 * @c FALSE is returned (this happens if the plugin does not contain | |
| 243 * the necessary information). | |
| 5205 | 244 */ |
| 245 gboolean gaim_plugin_register(GaimPlugin *plugin); | |
| 246 | |
| 247 /** | |
| 248 * Attempts to load a previously probed plugin. | |
| 249 * | |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6486
diff
changeset
|
250 * @param plugin The plugin to load. |
| 5205 | 251 * |
| 252 * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 253 * | |
| 254 * @see gaim_plugin_reload() | |
| 255 * @see gaim_plugin_unload() | |
| 256 */ | |
| 257 gboolean gaim_plugin_load(GaimPlugin *plugin); | |
| 258 | |
| 259 /** | |
| 260 * Unloads the specified plugin. | |
| 261 * | |
| 262 * @param plugin The plugin handle. | |
| 263 * | |
| 264 * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 265 * | |
| 266 * @see gaim_plugin_load() | |
| 267 * @see gaim_plugin_reload() | |
| 268 */ | |
| 269 gboolean gaim_plugin_unload(GaimPlugin *plugin); | |
| 270 | |
| 271 /** | |
| 272 * Reloads a plugin. | |
| 273 * | |
| 274 * @param plugin The old plugin handle. | |
|
6486
fab81e4b885c
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
275 * |
| 5205 | 276 * @return @c TRUE if successful, or @c FALSE otherwise. |
| 277 * | |
| 278 * @see gaim_plugin_load() | |
| 279 * @see gaim_plugin_unload() | |
| 280 */ | |
| 281 gboolean gaim_plugin_reload(GaimPlugin *plugin); | |
| 282 | |
| 283 /** | |
| 284 * Unloads a plugin and destroys the structure from memory. | |
| 285 * | |
| 286 * @param plugin The plugin handle. | |
| 287 */ | |
| 288 void gaim_plugin_destroy(GaimPlugin *plugin); | |
| 289 | |
| 290 /** | |
| 291 * Returns whether or not a plugin is currently loaded. | |
| 292 * | |
| 293 * @param plugin The plugin. | |
| 294 * | |
|
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
295 * @return @c TRUE if loaded, or @c FALSE otherwise. |
| 5205 | 296 */ |
| 297 gboolean gaim_plugin_is_loaded(const GaimPlugin *plugin); | |
| 298 | |
|
11772
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
299 /** |
|
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
300 * Returns whether or not a plugin is unloadable. |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
301 * |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
302 * If this returns @c TRUE, the plugin is guaranteed to not |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
303 * be loadable. However, a return value of @c FALSE does not |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
304 * guarantee the plugin is loadable. |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
305 * |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
306 * @param plugin The plugin. |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
307 * |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
308 * @return @c TRUE if the plugin is known to be unloadable,\ |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
309 * @c FALSE otherwise |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
310 */ |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
311 gboolean gaim_plugin_is_unloadable(const GaimPlugin *plugin); |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
312 |
|
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
313 /** |
|
11772
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
314 * Returns a plugin's id. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
315 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
316 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
317 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
318 * @return The plugin's id. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
319 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
320 const gchar *gaim_plugin_get_id(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
321 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
322 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
323 * Returns a plugin's name. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
324 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
325 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
326 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
327 * @return THe name of the plugin, or @c NULL. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
328 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
329 const gchar *gaim_plugin_get_name(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
330 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
331 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
332 * Returns a plugin's version. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
333 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
334 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
335 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
336 * @return The plugin's version or @c NULL. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
337 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
338 const gchar *gaim_plugin_get_version(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
339 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
340 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
341 * Returns a plugin's summary. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
342 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
343 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
344 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
345 * @return The plugin's summary. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
346 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
347 const gchar *gaim_plugin_get_summary(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
348 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
349 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
350 * Returns a plugin's description. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
351 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
352 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
353 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
354 * @return The plugin's description. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
355 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
356 const gchar *gaim_plugin_get_description(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
357 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
358 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
359 * Returns a plugin's author. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
360 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
361 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
362 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
363 * @return The plugin's author. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
364 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
365 const gchar *gaim_plugin_get_author(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
366 |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
367 /** |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
368 * Returns a plugin's homepage. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
369 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
370 * @param plugin The plugin. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
371 * |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
372 * @return The plugin's homepage. |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
373 */ |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
374 const gchar *gaim_plugin_get_homepage(const GaimPlugin *plugin); |
|
d1d5f27de95d
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
375 |
| 5205 | 376 /*@}*/ |
| 377 | |
| 378 /**************************************************************************/ | |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
379 /** @name Plugin IPC API */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
380 /**************************************************************************/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
381 /*@{*/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
382 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
383 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
384 * Registers an IPC command in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
385 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
386 * @param plugin The plugin to register the command with. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
387 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
388 * @param func The function to execute. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
389 * @param marshal The marshalling function. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
390 * @param ret_value The return value type. |
|
7114
c47633e9e2a4
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
7034
diff
changeset
|
391 * @param num_params The number of parameters. |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
392 * @param ... The parameter types. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
393 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
394 * @return TRUE if the function was registered successfully, or |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
395 * FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
396 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
397 gboolean gaim_plugin_ipc_register(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
398 GaimCallback func, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
399 GaimSignalMarshalFunc marshal, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
400 GaimValue *ret_value, int num_params, ...); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
401 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
402 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
403 * Unregisters an IPC command in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
404 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
405 * @param plugin The plugin to unregister the command from. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
406 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
407 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
408 void gaim_plugin_ipc_unregister(GaimPlugin *plugin, const char *command); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
409 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
410 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
411 * Unregisters all IPC commands in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
412 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
413 * @param plugin The plugin to unregister the commands from. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
414 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
415 void gaim_plugin_ipc_unregister_all(GaimPlugin *plugin); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
416 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
417 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
418 * Returns a list of value types used for an IPC command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
419 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
420 * @param plugin The plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
421 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
422 * @param ret_value The returned return value. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
423 * @param num_params The returned number of parameters. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
424 * @param params The returned list of parameters. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
425 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
426 * @return TRUE if the command was found, or FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
427 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
428 gboolean gaim_plugin_ipc_get_params(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
429 GaimValue **ret_value, int *num_params, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
430 GaimValue ***params); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
431 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
432 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
433 * Executes an IPC command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
434 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
435 * @param plugin The plugin to execute the command on. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
436 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
437 * @param ok TRUE if the call was successful, or FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
438 * @param ... The parameters to pass. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
439 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
440 * @return The return value, which will be NULL if the command doesn't |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
441 * return a value. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
442 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
443 void *gaim_plugin_ipc_call(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
444 gboolean *ok, ...); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
445 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
446 /*@}*/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
447 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
448 /**************************************************************************/ |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
449 /** @name Plugins API */ |
| 5205 | 450 /**************************************************************************/ |
| 451 /*@{*/ | |
| 452 | |
| 453 /** | |
| 10447 | 454 * Add a new directory to search for plugins |
| 5205 | 455 * |
| 10448 | 456 * @param path The new search path. |
| 5205 | 457 */ |
| 10447 | 458 void gaim_plugins_add_search_path(const char *path); |
| 5205 | 459 |
| 460 /** | |
|
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
461 * Unloads all loaded plugins. |
| 5205 | 462 */ |
| 463 void gaim_plugins_unload_all(void); | |
| 464 | |
|
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
465 /** |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
466 * Destroys all registered plugins. |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
467 */ |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
468 void gaim_plugins_destroy_all(void); |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
469 |
| 5205 | 470 /** |
|
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
471 * Attempts to load all the plugins in the specified preference key |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
472 * that were loaded when gaim last quit. |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
473 * |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
474 * @param key The preference key containing the list of plugins. |
| 5838 | 475 */ |
|
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
476 void gaim_plugins_load_saved(const char *key); |
| 5838 | 477 |
| 478 /** | |
| 5205 | 479 * Probes for plugins in the registered module paths. |
| 480 * | |
| 481 * @param ext The extension type to probe for, or @c NULL for all. | |
| 482 * | |
| 483 * @see gaim_plugin_set_probe_path() | |
| 484 */ | |
| 485 void gaim_plugins_probe(const char *ext); | |
| 486 | |
| 487 /** | |
| 488 * Returns whether or not plugin support is enabled. | |
| 489 * | |
| 490 * @return TRUE if plugin support is enabled, or FALSE otherwise. | |
| 491 */ | |
| 492 gboolean gaim_plugins_enabled(void); | |
| 493 | |
| 494 /** | |
| 495 * Registers a function that will be called when probing is finished. | |
| 496 * | |
| 497 * @param func The callback function. | |
| 498 * @param data Data to pass to the callback. | |
| 499 */ | |
| 500 void gaim_plugins_register_probe_notify_cb(void (*func)(void *), void *data); | |
| 501 | |
| 502 /** | |
| 503 * Unregisters a function that would be called when probing is finished. | |
| 504 * | |
| 505 * @param func The callback function. | |
| 506 */ | |
| 507 void gaim_plugins_unregister_probe_notify_cb(void (*func)(void *)); | |
| 508 | |
| 509 /** | |
| 510 * Registers a function that will be called when a plugin is loaded. | |
| 511 * | |
|
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
512 * @param func The callback function. |
| 5205 | 513 * @param data Data to pass to the callback. |
| 514 */ | |
| 515 void gaim_plugins_register_load_notify_cb(void (*func)(GaimPlugin *, void *), | |
| 516 void *data); | |
| 517 | |
| 518 /** | |
| 519 * Unregisters a function that would be called when a plugin is loaded. | |
| 520 * | |
|
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
521 * @param func The callback function. |
| 5205 | 522 */ |
| 523 void gaim_plugins_unregister_load_notify_cb(void (*func)(GaimPlugin *, void *)); | |
| 524 | |
| 525 /** | |
| 526 * Registers a function that will be called when a plugin is unloaded. | |
| 527 * | |
|
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
528 * @param func The callback function. |
| 5205 | 529 * @param data Data to pass to the callback. |
| 530 */ | |
| 531 void gaim_plugins_register_unload_notify_cb(void (*func)(GaimPlugin *, void *), | |
| 532 void *data); | |
| 533 | |
| 534 /** | |
| 535 * Unregisters a function that would be called when a plugin is unloaded. | |
| 536 * | |
|
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
537 * @param func The callback function. |
| 5205 | 538 */ |
| 539 void gaim_plugins_unregister_unload_notify_cb(void (*func)(GaimPlugin *, | |
| 540 void *)); | |
| 541 | |
| 542 /** | |
| 543 * Finds a plugin with the specified name. | |
| 544 * | |
| 545 * @param name The plugin name. | |
| 546 * | |
| 547 * @return The plugin if found, or @c NULL if not found. | |
| 548 */ | |
| 549 GaimPlugin *gaim_plugins_find_with_name(const char *name); | |
| 550 | |
| 551 /** | |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
552 * Finds a plugin with the specified filename (filename with a path). |
| 5205 | 553 * |
| 554 * @param filename The plugin filename. | |
| 555 * | |
| 556 * @return The plugin if found, or @c NULL if not found. | |
| 557 */ | |
| 558 GaimPlugin *gaim_plugins_find_with_filename(const char *filename); | |
| 559 | |
| 560 /** | |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
561 * Finds a plugin with the specified basename (filename without a path). |
|
7033
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
562 * |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
563 * @param basename The plugin basename. |
|
7033
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
564 * |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
565 * @return The plugin if found, or @c NULL if not found. |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
566 */ |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
567 GaimPlugin *gaim_plugins_find_with_basename(const char *basename); |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
568 |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
569 /** |
| 5205 | 570 * Finds a plugin with the specified plugin ID. |
| 571 * | |
| 572 * @param id The plugin ID. | |
| 573 * | |
| 574 * @return The plugin if found, or @c NULL if not found. | |
| 575 */ | |
| 576 GaimPlugin *gaim_plugins_find_with_id(const char *id); | |
| 577 | |
| 578 /** | |
| 579 * Returns a list of all loaded plugins. | |
| 580 * | |
|
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
581 * @return A list of all loaded plugins. |
| 5205 | 582 */ |
| 583 GList *gaim_plugins_get_loaded(void); | |
| 584 | |
| 585 /** | |
| 11950 | 586 * Returns a list of all valid protocol plugins. A protocol |
| 587 * plugin is considered invalid if it does not contain the call | |
| 588 * to the GAIM_INIT_PLUGIN() macro, or if it was compiled | |
| 589 * against an incompatable API version. | |
|
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
590 * |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
591 * @return A list of all protocol plugins. |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
592 */ |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
593 GList *gaim_plugins_get_protocols(void); |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
594 |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
595 /** |
| 5205 | 596 * Returns a list of all plugins, whether loaded or not. |
| 597 * | |
| 598 * @return A list of all plugins. | |
| 599 */ | |
| 600 GList *gaim_plugins_get_all(void); | |
| 601 | |
| 602 /*@}*/ | |
| 603 | |
| 10479 | 604 /**************************************************************************/ |
| 605 /** @name Plugins SubSytem API */ | |
| 606 /**************************************************************************/ | |
| 607 /*@{*/ | |
| 608 | |
| 609 /** | |
| 610 * Returns the plugin subsystem handle. | |
| 611 * | |
| 612 * @return The plugin sybsystem handle. | |
| 613 */ | |
| 614 void *gaim_plugins_get_handle(void); | |
| 615 | |
| 616 /** | |
| 617 * Initializes the plugin subsystem | |
| 618 */ | |
| 619 void gaim_plugins_init(void); | |
| 620 | |
| 621 /** | |
| 622 * Uninitializes the plugin subsystem | |
| 623 */ | |
| 624 void gaim_plugins_uninit(void); | |
| 625 | |
| 626 /*@}*/ | |
| 9015 | 627 |
| 628 /** | |
| 629 * Allocates and returns a new GaimPluginAction. | |
|
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
630 * |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
631 * @param label The description of the action to show to the user. |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
632 * @param callback The callback to call when the user selects this action. |
| 9015 | 633 */ |
|
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
634 GaimPluginAction *gaim_plugin_action_new(const char* label, void (*callback)(GaimPluginAction *)); |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
635 |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
636 /** |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
637 * Frees a GaimPluginAction |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
638 * |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
639 * @param action The GaimPluginAction to free. |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
640 */ |
|
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12986
diff
changeset
|
641 void gaim_plugin_action_free(GaimPluginAction *action); |
| 9015 | 642 |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
643 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
644 } |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
645 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
646 |
| 5205 | 647 #endif /* _GAIM_PLUGIN_H_ */ |
