Mercurial > pidgin
annotate src/plugin.h @ 8992:f15fcdbecf0a
[gaim-migrate @ 9767]
Apparently we were shy on quoting ... this autoconf stuff needs seriuos TLC
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 20 May 2004 23:52:10 +0000 |
parents | c209e287bb6e |
children | 67421e0dc497 |
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 | |
38 typedef int GaimPluginPriority; /**< Plugin priority. */ | |
39 | |
8713 | 40 #include "pluginpref.h" |
41 | |
5205 | 42 /** |
43 * Plugin types. | |
44 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
45 typedef enum |
5205 | 46 { |
47 GAIM_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ | |
48 GAIM_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
49 GAIM_PLUGIN_LOADER, /**< Loader plugin. */ | |
50 GAIM_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
51 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
52 } GaimPluginType; |
5205 | 53 |
54 #define GAIM_PRIORITY_DEFAULT 0 | |
55 #define GAIM_PRIORITY_HIGHEST 9999 | |
56 #define GAIM_PRIORITY_LOWEST -9999 | |
57 | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
58 #define GAIM_PLUGIN_FLAG_INVISIBLE 0x01 |
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
59 |
8990 | 60 #define GAIM_PLUGIN_API_VERSION 4 |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
61 #define GAIM_LOADER_API_VERSION 2 |
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
62 |
5205 | 63 /** |
64 * Detailed information about a plugin. | |
65 * | |
66 * This is used in the version 2.0 API and up. | |
67 */ | |
68 struct _GaimPluginInfo | |
69 { | |
70 unsigned int api_version; | |
71 GaimPluginType type; | |
72 char *ui_requirement; | |
73 unsigned long flags; | |
74 GList *dependencies; | |
75 GaimPluginPriority priority; | |
76 | |
77 char *id; | |
78 char *name; | |
79 char *version; | |
80 char *summary; | |
81 char *description; | |
82 char *author; | |
83 char *homepage; | |
84 | |
85 gboolean (*load)(GaimPlugin *plugin); | |
86 gboolean (*unload)(GaimPlugin *plugin); | |
87 void (*destroy)(GaimPlugin *plugin); | |
88 | |
89 void *ui_info; | |
90 void *extra_info; | |
8814 | 91 GaimPluginUiInfo *prefs_info; |
8986 | 92 GList *(*actions)(GaimPlugin *plugin); |
5205 | 93 }; |
94 | |
95 /** | |
96 * Extra information for loader plugins. | |
97 */ | |
98 struct _GaimPluginLoaderInfo | |
99 { | |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
100 unsigned int api_version; |
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
101 |
5205 | 102 GList *exts; |
103 | |
104 gboolean (*probe)(GaimPlugin *plugin); | |
105 gboolean (*load)(GaimPlugin *plugin); | |
106 gboolean (*unload)(GaimPlugin *plugin); | |
107 void (*destroy)(GaimPlugin *plugin); | |
108 }; | |
109 | |
110 /** | |
111 * A plugin handle. | |
112 */ | |
113 struct _GaimPlugin | |
114 { | |
115 gboolean native_plugin; /**< Native C plugin. */ | |
116 gboolean loaded; /**< The loaded state. */ | |
117 void *handle; /**< The module handle. */ | |
118 char *path; /**< The path to the plugin. */ | |
119 GaimPluginInfo *info; /**< The plugin information. */ | |
120 char *error; | |
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
121 void *ipc_data; /**< IPC data. */ |
5205 | 122 void *extra; /**< Plugin-specific data. */ |
123 }; | |
124 | |
125 #define GAIM_PLUGIN_LOADER_INFO(plugin) \ | |
126 ((GaimPluginLoaderInfo *)(plugin)->info->extra_info) | |
127 | |
8713 | 128 struct _GaimPluginUiInfo { |
129 GaimPluginPrefFrame *(*get_plugin_pref_frame)(GaimPlugin *plugin); | |
130 | |
131 void *iter; /**< Reserved */ | |
8814 | 132 GaimPluginPrefFrame *frame; /**< Reserved */ |
8713 | 133 }; |
134 | |
135 #define GAIM_PLUGIN_HAS_PREF_FRAME(plugin) \ | |
136 ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL) | |
137 | |
138 #define GAIM_PLUGIN_UI_INFO(plugin) \ | |
139 ((GaimPluginUiInfo*)(plugin)->info->prefs_info) | |
140 | |
5205 | 141 /** |
142 * Handles the initialization of modules. | |
143 */ | |
8082 | 144 #if !defined(GAIM_PLUGINS) || defined(GAIM_STATIC_PRPL) |
5205 | 145 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
146 gboolean gaim_init_##pluginname##_plugin(void) { \ | |
147 GaimPlugin *plugin = gaim_plugin_new(TRUE, NULL); \ | |
148 plugin->info = &(plugininfo); \ | |
149 initfunc((plugin)); \ | |
150 return gaim_plugin_register(plugin); \ | |
151 } | |
8082 | 152 #else /* GAIM_PLUGINS && !GAIM_STATIC_PRPL */ |
5205 | 153 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5205
diff
changeset
|
154 G_MODULE_EXPORT gboolean gaim_init_plugin(GaimPlugin *plugin) { \ |
5205 | 155 plugin->info = &(plugininfo); \ |
156 initfunc((plugin)); \ | |
157 return gaim_plugin_register(plugin); \ | |
158 } | |
159 #endif | |
160 | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
161 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
162 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
163 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
164 |
8986 | 165 |
166 void *gaim_plugins_get_handle(void); | |
167 | |
168 | |
5205 | 169 /**************************************************************************/ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
170 /** @name Plugin API */ |
5205 | 171 /**************************************************************************/ |
172 /*@{*/ | |
173 | |
174 /** | |
175 * Creates a new plugin structure. | |
176 * | |
177 * @param native Whether or not the plugin is native. | |
178 * @param path The path to the plugin, or @c NULL if statically compiled. | |
179 * | |
180 * @return A new GaimPlugin structure. | |
181 */ | |
182 GaimPlugin *gaim_plugin_new(gboolean native, const char *path); | |
183 | |
184 /** | |
185 * Probes a plugin, retrieving the information on it and adding it to the | |
186 * list of available plugins. | |
187 * | |
188 * @param filename The plugin's filename. | |
189 * | |
190 * @return The plugin handle. | |
191 * | |
192 * @see gaim_plugin_load() | |
193 * @see gaim_plugin_destroy() | |
194 */ | |
195 GaimPlugin *gaim_plugin_probe(const char *filename); | |
196 | |
197 /** | |
198 * Registers a plugin and prepares it for loading. | |
199 * | |
200 * This shouldn't be called by anything but the internal module code. | |
201 * | |
202 * @param plugin The plugin to register. | |
203 */ | |
204 gboolean gaim_plugin_register(GaimPlugin *plugin); | |
205 | |
206 /** | |
207 * Attempts to load a previously probed plugin. | |
208 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6486
diff
changeset
|
209 * @param plugin The plugin to load. |
5205 | 210 * |
211 * @return @c TRUE if successful, or @c FALSE otherwise. | |
212 * | |
213 * @see gaim_plugin_reload() | |
214 * @see gaim_plugin_unload() | |
215 */ | |
216 gboolean gaim_plugin_load(GaimPlugin *plugin); | |
217 | |
218 /** | |
219 * Unloads the specified plugin. | |
220 * | |
221 * @param plugin The plugin handle. | |
222 * | |
223 * @return @c TRUE if successful, or @c FALSE otherwise. | |
224 * | |
225 * @see gaim_plugin_load() | |
226 * @see gaim_plugin_reload() | |
227 */ | |
228 gboolean gaim_plugin_unload(GaimPlugin *plugin); | |
229 | |
230 /** | |
231 * Reloads a plugin. | |
232 * | |
233 * @param plugin The old plugin handle. | |
6486
fab81e4b885c
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
234 * |
5205 | 235 * @return @c TRUE if successful, or @c FALSE otherwise. |
236 * | |
237 * @see gaim_plugin_load() | |
238 * @see gaim_plugin_unload() | |
239 */ | |
240 gboolean gaim_plugin_reload(GaimPlugin *plugin); | |
241 | |
242 /** | |
243 * Unloads a plugin and destroys the structure from memory. | |
244 * | |
245 * @param plugin The plugin handle. | |
246 */ | |
247 void gaim_plugin_destroy(GaimPlugin *plugin); | |
248 | |
249 /** | |
250 * Returns whether or not a plugin is currently loaded. | |
251 * | |
252 * @param plugin The plugin. | |
253 * | |
254 * @return TRUE if loaded, or FALSE otherwise. | |
255 */ | |
256 gboolean gaim_plugin_is_loaded(const GaimPlugin *plugin); | |
257 | |
258 /*@}*/ | |
259 | |
260 /**************************************************************************/ | |
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
261 /** @name Plugin IPC API */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
262 /**************************************************************************/ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
263 /*@{*/ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
264 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
265 /** |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
266 * Registers an IPC command in a plugin. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
267 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
268 * @param plugin The plugin to register the command with. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
269 * @param command The name of the command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
270 * @param func The function to execute. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
271 * @param marshal The marshalling function. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
272 * @param ret_value The return value type. |
7114
c47633e9e2a4
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
7034
diff
changeset
|
273 * @param num_params The number of parameters. |
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
274 * @param ... The parameter types. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
275 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
276 * @return TRUE if the function was registered successfully, or |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
277 * FALSE otherwise. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
278 */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
279 gboolean gaim_plugin_ipc_register(GaimPlugin *plugin, const char *command, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
280 GaimCallback func, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
281 GaimSignalMarshalFunc marshal, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
282 GaimValue *ret_value, int num_params, ...); |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
283 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
284 /** |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
285 * Unregisters an IPC command in a plugin. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
286 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
287 * @param plugin The plugin to unregister the command from. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
288 * @param command The name of the command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
289 */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
290 void gaim_plugin_ipc_unregister(GaimPlugin *plugin, const char *command); |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
291 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
292 /** |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
293 * Unregisters all IPC commands in a plugin. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
294 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
295 * @param plugin The plugin to unregister the commands from. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
296 */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
297 void gaim_plugin_ipc_unregister_all(GaimPlugin *plugin); |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
298 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
299 /** |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
300 * Returns a list of value types used for an IPC command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
301 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
302 * @param plugin The plugin. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
303 * @param command The name of the command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
304 * @param ret_value The returned return value. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
305 * @param num_params The returned number of parameters. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
306 * @param params The returned list of parameters. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
307 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
308 * @return TRUE if the command was found, or FALSE otherwise. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
309 */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
310 gboolean gaim_plugin_ipc_get_params(GaimPlugin *plugin, const char *command, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
311 GaimValue **ret_value, int *num_params, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
312 GaimValue ***params); |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
313 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
314 /** |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
315 * Executes an IPC command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
316 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
317 * @param plugin The plugin to execute the command on. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
318 * @param command The name of the command. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
319 * @param ok TRUE if the call was successful, or FALSE otherwise. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
320 * @param ... The parameters to pass. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
321 * |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
322 * @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
|
323 * return a value. |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
324 */ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
325 void *gaim_plugin_ipc_call(GaimPlugin *plugin, const char *command, |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
326 gboolean *ok, ...); |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
327 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
328 /*@}*/ |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
329 |
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
330 /**************************************************************************/ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
331 /** @name Plugins API */ |
5205 | 332 /**************************************************************************/ |
333 /*@{*/ | |
334 | |
335 /** | |
336 * Sets the search paths for plugins. | |
337 * | |
338 * @param count The number of search paths. | |
339 * @param paths The search paths. | |
340 */ | |
341 void gaim_plugins_set_search_paths(size_t count, char **paths); | |
342 | |
343 /** | |
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
344 * Unloads all loaded plugins. |
5205 | 345 */ |
346 void gaim_plugins_unload_all(void); | |
347 | |
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
348 /** |
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
349 * Destroys all registered plugins. |
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
350 */ |
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
351 void gaim_plugins_destroy_all(void); |
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
352 |
5205 | 353 /** |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
354 * Attempts to load all the plugins in the specified preference key |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
355 * that were loaded when gaim last quit. |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
356 * |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
357 * @param key The preference key containing the list of plugins. |
5838 | 358 */ |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
359 void gaim_plugins_load_saved(const char *key); |
5838 | 360 |
361 /** | |
5205 | 362 * Probes for plugins in the registered module paths. |
363 * | |
364 * @param ext The extension type to probe for, or @c NULL for all. | |
365 * | |
366 * @see gaim_plugin_set_probe_path() | |
367 */ | |
368 void gaim_plugins_probe(const char *ext); | |
369 | |
370 /** | |
371 * Returns whether or not plugin support is enabled. | |
372 * | |
373 * @return TRUE if plugin support is enabled, or FALSE otherwise. | |
374 */ | |
375 gboolean gaim_plugins_enabled(void); | |
376 | |
377 /** | |
378 * Registers a function that will be called when probing is finished. | |
379 * | |
380 * @param func The callback function. | |
381 * @param data Data to pass to the callback. | |
382 */ | |
383 void gaim_plugins_register_probe_notify_cb(void (*func)(void *), void *data); | |
384 | |
385 /** | |
386 * Unregisters a function that would be called when probing is finished. | |
387 * | |
388 * @param func The callback function. | |
389 */ | |
390 void gaim_plugins_unregister_probe_notify_cb(void (*func)(void *)); | |
391 | |
392 /** | |
393 * Registers a function that will be called when a plugin is loaded. | |
394 * | |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
395 * @param func The callback function. |
5205 | 396 * @param data Data to pass to the callback. |
397 */ | |
398 void gaim_plugins_register_load_notify_cb(void (*func)(GaimPlugin *, void *), | |
399 void *data); | |
400 | |
401 /** | |
402 * Unregisters a function that would be called when a plugin is loaded. | |
403 * | |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
404 * @param func The callback function. |
5205 | 405 */ |
406 void gaim_plugins_unregister_load_notify_cb(void (*func)(GaimPlugin *, void *)); | |
407 | |
408 /** | |
409 * Registers a function that will be called when a plugin is unloaded. | |
410 * | |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
411 * @param func The callback function. |
5205 | 412 * @param data Data to pass to the callback. |
413 */ | |
414 void gaim_plugins_register_unload_notify_cb(void (*func)(GaimPlugin *, void *), | |
415 void *data); | |
416 | |
417 /** | |
418 * Unregisters a function that would be called when a plugin is unloaded. | |
419 * | |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
420 * @param func The callback function. |
5205 | 421 */ |
422 void gaim_plugins_unregister_unload_notify_cb(void (*func)(GaimPlugin *, | |
423 void *)); | |
424 | |
425 /** | |
426 * Finds a plugin with the specified name. | |
427 * | |
428 * @param name The plugin name. | |
429 * | |
430 * @return The plugin if found, or @c NULL if not found. | |
431 */ | |
432 GaimPlugin *gaim_plugins_find_with_name(const char *name); | |
433 | |
434 /** | |
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
435 * Finds a plugin with the specified filename (filename with a path). |
5205 | 436 * |
437 * @param filename The plugin filename. | |
438 * | |
439 * @return The plugin if found, or @c NULL if not found. | |
440 */ | |
441 GaimPlugin *gaim_plugins_find_with_filename(const char *filename); | |
442 | |
443 /** | |
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
444 * 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
|
445 * |
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
446 * @param basename The plugin basename. |
7033
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
447 * |
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
448 * @return The plugin if found, or @c NULL if not found. |
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
449 */ |
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
450 GaimPlugin *gaim_plugins_find_with_basename(const char *basename); |
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
451 |
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
452 /** |
5205 | 453 * Finds a plugin with the specified plugin ID. |
454 * | |
455 * @param id The plugin ID. | |
456 * | |
457 * @return The plugin if found, or @c NULL if not found. | |
458 */ | |
459 GaimPlugin *gaim_plugins_find_with_id(const char *id); | |
460 | |
461 /** | |
462 * Returns a list of all loaded plugins. | |
463 * | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
464 * @return A list of all loaded plugins. |
5205 | 465 */ |
466 GList *gaim_plugins_get_loaded(void); | |
467 | |
468 /** | |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
469 * Returns a list of all protocol plugins. |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
470 * |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
471 * @return A list of all protocol plugins. |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
472 */ |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
473 GList *gaim_plugins_get_protocols(void); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
474 |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
475 /** |
5205 | 476 * Returns a list of all plugins, whether loaded or not. |
477 * | |
478 * @return A list of all plugins. | |
479 */ | |
480 GList *gaim_plugins_get_all(void); | |
481 | |
482 /*@}*/ | |
483 | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
484 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
485 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
486 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
487 |
5205 | 488 #endif /* _GAIM_PLUGIN_H_ */ |