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