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