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