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