Sat, 29 Aug 2009 00:45:37 +0000
propagate from branch 'im.pidgin.pidgin' (head 32da7ab6d1092d199f3c54e43644fb6303f82bd2)
to branch 'im.pidgin.soc.2008.masterpassword' (head e0ce5fb11bdba2ac134e9675ce4dffd3f43e0418)
| 5205 | 1 | /** |
| 2 | * @file plugin.h Plugin API | |
| 3 | * @ingroup core | |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
4 | * @see @ref plugin-signals |
|
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
5 | * @see @ref plugin-ids |
|
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
6 | * @see @ref plugin-i18n |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
7 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
8 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
9 | /* purple |
| 5205 | 10 | * |
| 15884 | 11 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 12 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 13 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
5949
diff
changeset
|
14 | * |
| 5205 | 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by | |
| 17 | * the Free Software Foundation; either version 2 of the License, or | |
| 18 | * (at your option) any later version. | |
| 19 | * | |
| 20 | * This program is distributed in the hope that it will be useful, | |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 | * GNU General Public License for more details. | |
| 24 | * | |
| 25 | * You should have received a copy of the GNU General Public License | |
| 26 | * 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
|
27 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5205 | 28 | */ |
| 15884 | 29 | #ifndef _PURPLE_PLUGIN_H_ |
| 30 | #define _PURPLE_PLUGIN_H_ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
31 | |
|
26726
b81bcec8f359
Updates for GTK+ 3.0. Remove some deprecated functions (someone should
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25911
diff
changeset
|
32 | #include <glib.h> |
|
5224
8cb89f5b912a
[gaim-migrate @ 5594]
Herman Bloggs <herman@bluedigits.com>
parents:
5205
diff
changeset
|
33 | #include <gmodule.h> |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
34 | #include "signals.h" |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
35 | #include "value.h" |
| 5205 | 36 | |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
37 | /** @copydoc _PurplePlugin */ |
| 15884 | 38 | typedef struct _PurplePlugin PurplePlugin; |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
39 | /** @copydoc _PurplePluginInfo */ |
| 15884 | 40 | typedef struct _PurplePluginInfo PurplePluginInfo; |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
41 | /** @copydoc _PurplePluginUiInfo */ |
| 15884 | 42 | typedef struct _PurplePluginUiInfo PurplePluginUiInfo; |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
43 | /** @copydoc _PurplePluginLoaderInfo */ |
| 15884 | 44 | typedef struct _PurplePluginLoaderInfo PurplePluginLoaderInfo; |
| 5205 | 45 | |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
46 | /** @copydoc _PurplePluginAction */ |
| 15884 | 47 | typedef struct _PurplePluginAction PurplePluginAction; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
48 | |
| 15884 | 49 | typedef int PurplePluginPriority; /**< Plugin priority. */ |
| 5205 | 50 | |
| 8713 | 51 | #include "pluginpref.h" |
| 52 | ||
| 5205 | 53 | /** |
| 54 | * Plugin types. | |
| 55 | */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
56 | typedef enum |
| 5205 | 57 | { |
| 15884 | 58 | PURPLE_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ |
| 59 | PURPLE_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
| 60 | PURPLE_PLUGIN_LOADER, /**< Loader plugin. */ | |
| 61 | PURPLE_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
62 | |
| 15884 | 63 | } PurplePluginType; |
| 5205 | 64 | |
| 15884 | 65 | #define PURPLE_PRIORITY_DEFAULT 0 |
| 66 | #define PURPLE_PRIORITY_HIGHEST 9999 | |
| 67 | #define PURPLE_PRIORITY_LOWEST -9999 | |
| 5205 | 68 | |
| 15884 | 69 | #define PURPLE_PLUGIN_FLAG_INVISIBLE 0x01 |
|
33966
09490ce8a695
updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
21453
diff
changeset
|
70 | #define PURPLE_PLUGIN_FLAG_AUTOLOAD 0x02 |
|
6928
17e0c572bd97
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
71 | |
| 15884 | 72 | #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
|
73 | |
| 5205 | 74 | /** |
| 75 | * Detailed information about a plugin. | |
| 76 | * | |
| 77 | * This is used in the version 2.0 API and up. | |
| 78 | */ | |
| 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. */ |
|
26833
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
109 | |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
110 | /** |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
111 | * This callback has a different use depending on whether this |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
112 | * plugin type is PURPLE_PLUGIN_STANDARD or PURPLE_PLUGIN_PROTOCOL. |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
113 | * |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
114 | * If PURPLE_PLUGIN_STANDARD then the list of actions will show up |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
115 | * in the Tools menu, under a submenu with the name of the plugin. |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
116 | * context will be NULL. |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
117 | * |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
118 | * If PURPLE_PLUGIN_PROTOCOL then the list of actions will show up |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
119 | * in the Accounts menu, under a submenu with the name of the |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
120 | * account. context will be set to the PurpleConnection for that |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
121 | * account. This callback will only be called for online accounts. |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
122 | */ |
| 15884 | 123 | 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
|
124 | |
|
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_reserved1)(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_reserved2)(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_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
128 | void (*_purple_reserved4)(void); |
| 5205 | 129 | }; |
| 130 | ||
| 131 | /** | |
| 132 | * Extra information for loader plugins. | |
| 133 | */ | |
| 15884 | 134 | struct _PurplePluginLoaderInfo |
| 5205 | 135 | { |
| 136 | GList *exts; | |
| 137 | ||
| 15884 | 138 | gboolean (*probe)(PurplePlugin *plugin); |
| 139 | gboolean (*load)(PurplePlugin *plugin); | |
| 140 | gboolean (*unload)(PurplePlugin *plugin); | |
| 141 | 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
|
142 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
143 | 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
|
144 | 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
|
145 | 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
|
146 | void (*_purple_reserved4)(void); |
| 5205 | 147 | }; |
| 148 | ||
| 149 | /** | |
| 150 | * A plugin handle. | |
| 151 | */ | |
| 15884 | 152 | struct _PurplePlugin |
| 5205 | 153 | { |
| 154 | gboolean native_plugin; /**< Native C plugin. */ | |
| 155 | gboolean loaded; /**< The loaded state. */ | |
| 156 | void *handle; /**< The module handle. */ | |
| 157 | char *path; /**< The path to the plugin. */ | |
| 15884 | 158 | PurplePluginInfo *info; /**< The plugin information. */ |
| 5205 | 159 | char *error; |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
160 | void *ipc_data; /**< IPC data. */ |
| 5205 | 161 | void *extra; /**< Plugin-specific data. */ |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
162 | gboolean unloadable; /**< Unloadable */ |
| 12926 | 163 | 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
|
164 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
165 | 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
|
166 | 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
|
167 | 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
|
168 | void (*_purple_reserved4)(void); |
| 5205 | 169 | }; |
| 170 | ||
| 15884 | 171 | #define PURPLE_PLUGIN_LOADER_INFO(plugin) \ |
| 172 | ((PurplePluginLoaderInfo *)(plugin)->info->extra_info) | |
| 5205 | 173 | |
| 15884 | 174 | struct _PurplePluginUiInfo { |
| 175 | PurplePluginPrefFrame *(*get_plugin_pref_frame)(PurplePlugin *plugin); | |
| 8713 | 176 | |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10710
diff
changeset
|
177 | int page_num; /**< Reserved */ |
| 15884 | 178 | 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
|
179 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
180 | 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
|
181 | 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
|
182 | 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
|
183 | void (*_purple_reserved4)(void); |
| 8713 | 184 | }; |
| 185 | ||
| 15884 | 186 | #define PURPLE_PLUGIN_HAS_PREF_FRAME(plugin) \ |
| 8713 | 187 | ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL) |
| 188 | ||
| 15884 | 189 | #define PURPLE_PLUGIN_UI_INFO(plugin) \ |
| 190 | ((PurplePluginUiInfo*)(plugin)->info->prefs_info) | |
| 8713 | 191 | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
192 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
193 | /** |
| 15884 | 194 | * The structure used in the actions member of PurplePluginInfo |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
195 | */ |
| 15884 | 196 | struct _PurplePluginAction { |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
197 | char *label; |
| 15884 | 198 | void (*callback)(PurplePluginAction *); |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
199 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
200 | /** set to the owning plugin */ |
| 15884 | 201 | PurplePlugin *plugin; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
202 | |
| 15884 | 203 | /** 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
|
204 | account actions menu */ |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
205 | gpointer context; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
24569
diff
changeset
|
206 | |
|
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
|
207 | gpointer user_data; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
208 | }; |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
209 | |
| 15884 | 210 | #define PURPLE_PLUGIN_HAS_ACTIONS(plugin) \ |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
211 | ((plugin)->info != NULL && (plugin)->info->actions != NULL) |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
212 | |
| 15884 | 213 | #define PURPLE_PLUGIN_ACTIONS(plugin, context) \ |
| 214 | (PURPLE_PLUGIN_HAS_ACTIONS(plugin)? \ | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
215 | (plugin)->info->actions(plugin, context): NULL) |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
216 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
217 | |
| 5205 | 218 | /** |
| 219 | * Handles the initialization of modules. | |
| 220 | */ | |
| 15884 | 221 | #if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) |
|
23859
205579211cd3
Allow macros in the plugin name when compiling statically.
Evan Schoenberg <evands@pidgin.im>
parents:
21453
diff
changeset
|
222 | # define _FUNC_NAME(x) purple_init_##x##_plugin |
| 15884 | 223 | # define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
|
23859
205579211cd3
Allow macros in the plugin name when compiling statically.
Evan Schoenberg <evands@pidgin.im>
parents:
21453
diff
changeset
|
224 | gboolean _FUNC_NAME(pluginname)(void);\ |
|
205579211cd3
Allow macros in the plugin name when compiling statically.
Evan Schoenberg <evands@pidgin.im>
parents:
21453
diff
changeset
|
225 | gboolean _FUNC_NAME(pluginname)(void) { \ |
| 15884 | 226 | PurplePlugin *plugin = purple_plugin_new(TRUE, NULL); \ |
| 5205 | 227 | plugin->info = &(plugininfo); \ |
| 228 | initfunc((plugin)); \ | |
| 15884 | 229 | purple_plugin_load((plugin)); \ |
| 230 | return purple_plugin_register(plugin); \ | |
| 5205 | 231 | } |
| 15884 | 232 | #else /* PURPLE_PLUGINS && !PURPLE_STATIC_PRPL */ |
| 233 | # define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ | |
| 234 | G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin); \ | |
| 235 | G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin) { \ | |
| 5205 | 236 | plugin->info = &(plugininfo); \ |
| 237 | initfunc((plugin)); \ | |
| 15884 | 238 | return purple_plugin_register(plugin); \ |
| 5205 | 239 | } |
| 240 | #endif | |
| 241 | ||
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
242 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
243 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
244 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
245 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
246 | |
| 5205 | 247 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
248 | /** @name Plugin API */ |
| 5205 | 249 | /**************************************************************************/ |
| 250 | /*@{*/ | |
| 251 | ||
| 252 | /** | |
| 253 | * Creates a new plugin structure. | |
| 254 | * | |
| 255 | * @param native Whether or not the plugin is native. | |
| 256 | * @param path The path to the plugin, or @c NULL if statically compiled. | |
| 257 | * | |
| 15884 | 258 | * @return A new PurplePlugin structure. |
| 5205 | 259 | */ |
| 15884 | 260 | PurplePlugin *purple_plugin_new(gboolean native, const char *path); |
| 5205 | 261 | |
| 262 | /** | |
| 263 | * Probes a plugin, retrieving the information on it and adding it to the | |
| 264 | * list of available plugins. | |
| 265 | * | |
| 266 | * @param filename The plugin's filename. | |
| 267 | * | |
| 268 | * @return The plugin handle. | |
| 269 | * | |
| 15884 | 270 | * @see purple_plugin_load() |
| 271 | * @see purple_plugin_destroy() | |
| 5205 | 272 | */ |
| 15884 | 273 | PurplePlugin *purple_plugin_probe(const char *filename); |
| 5205 | 274 | |
| 275 | /** | |
| 276 | * Registers a plugin and prepares it for loading. | |
| 277 | * | |
| 278 | * This shouldn't be called by anything but the internal module code. | |
| 15884 | 279 | * 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
|
280 | * with the core. |
| 5205 | 281 | * |
| 282 | * @param plugin The plugin to register. | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
283 | * |
|
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
284 | * @return @c TRUE if the plugin was registered successfully. Otherwise |
|
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
285 | * @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
|
286 | * the necessary information). |
| 5205 | 287 | */ |
| 15884 | 288 | gboolean purple_plugin_register(PurplePlugin *plugin); |
| 5205 | 289 | |
| 290 | /** | |
| 291 | * Attempts to load a previously probed plugin. | |
| 292 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6486
diff
changeset
|
293 | * @param plugin The plugin to load. |
| 5205 | 294 | * |
| 295 | * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 296 | * | |
| 15884 | 297 | * @see purple_plugin_reload() |
| 298 | * @see purple_plugin_unload() | |
| 5205 | 299 | */ |
| 15884 | 300 | gboolean purple_plugin_load(PurplePlugin *plugin); |
| 5205 | 301 | |
| 302 | /** | |
| 303 | * Unloads the specified plugin. | |
| 304 | * | |
| 305 | * @param plugin The plugin handle. | |
| 306 | * | |
| 307 | * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 308 | * | |
| 15884 | 309 | * @see purple_plugin_load() |
| 310 | * @see purple_plugin_reload() | |
| 5205 | 311 | */ |
| 15884 | 312 | gboolean purple_plugin_unload(PurplePlugin *plugin); |
| 5205 | 313 | |
| 314 | /** | |
|
20870
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
315 | * Disable a plugin. |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
316 | * |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
317 | * This function adds the plugin to a list of plugins to "disable at the next |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
318 | * startup" by excluding said plugins from the list of plugins to save. The |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
319 | * UI needs to call purple_plugins_save_loaded() after calling this for it |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
320 | * to have any effect. |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
321 | * |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
322 | * @since 2.3.0 |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
323 | */ |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
324 | void purple_plugin_disable(PurplePlugin *plugin); |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
325 | |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
326 | /** |
| 5205 | 327 | * Reloads a plugin. |
| 328 | * | |
| 329 | * @param plugin The old plugin handle. | |
|
6486
18da8fdbc85b
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
330 | * |
| 5205 | 331 | * @return @c TRUE if successful, or @c FALSE otherwise. |
| 332 | * | |
| 15884 | 333 | * @see purple_plugin_load() |
| 334 | * @see purple_plugin_unload() | |
| 5205 | 335 | */ |
| 15884 | 336 | gboolean purple_plugin_reload(PurplePlugin *plugin); |
| 5205 | 337 | |
| 338 | /** | |
| 339 | * Unloads a plugin and destroys the structure from memory. | |
| 340 | * | |
| 341 | * @param plugin The plugin handle. | |
| 342 | */ | |
| 15884 | 343 | void purple_plugin_destroy(PurplePlugin *plugin); |
| 5205 | 344 | |
| 345 | /** | |
| 346 | * Returns whether or not a plugin is currently loaded. | |
| 347 | * | |
| 348 | * @param plugin The plugin. | |
| 349 | * | |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
350 | * @return @c TRUE if loaded, or @c FALSE otherwise. |
| 5205 | 351 | */ |
| 15884 | 352 | gboolean purple_plugin_is_loaded(const PurplePlugin *plugin); |
| 5205 | 353 | |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
354 | /** |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
355 | * Returns whether or not a plugin is unloadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
356 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
357 | * If this returns @c TRUE, the plugin is guaranteed to not |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
358 | * be loadable. However, a return value of @c FALSE does not |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
359 | * guarantee the plugin is loadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
360 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
361 | * @param plugin The plugin. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
362 | * |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
363 | * @return @c TRUE if the plugin is known to be unloadable,\ |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
364 | * @c FALSE otherwise |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
365 | */ |
| 15884 | 366 | gboolean purple_plugin_is_unloadable(const PurplePlugin *plugin); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
367 | |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
368 | /** |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
369 | * Returns a plugin's id. |
|
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 id. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
374 | */ |
| 15884 | 375 | const gchar *purple_plugin_get_id(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 name. |
|
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. |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
24569
diff
changeset
|
381 | * |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
382 | * @return THe name of the plugin, or @c NULL. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
383 | */ |
| 15884 | 384 | const gchar *purple_plugin_get_name(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 version. |
|
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 version or @c NULL. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
392 | */ |
| 15884 | 393 | const gchar *purple_plugin_get_version(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 summary. |
|
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 summary. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
401 | */ |
| 15884 | 402 | const gchar *purple_plugin_get_summary(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
403 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
404 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
405 | * Returns a plugin's description. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
406 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
407 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
408 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
409 | * @return The plugin's description. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
410 | */ |
| 15884 | 411 | const gchar *purple_plugin_get_description(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
412 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
413 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
414 | * Returns a plugin's author. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
415 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
416 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
417 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
418 | * @return The plugin's author. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
419 | */ |
| 15884 | 420 | const gchar *purple_plugin_get_author(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
421 | |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
422 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
423 | * Returns a plugin's homepage. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
424 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
425 | * @param plugin The plugin. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
426 | * |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
427 | * @return The plugin's homepage. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
428 | */ |
| 15884 | 429 | const gchar *purple_plugin_get_homepage(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
430 | |
| 5205 | 431 | /*@}*/ |
| 432 | ||
| 433 | /**************************************************************************/ | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
434 | /** @name Plugin IPC API */ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
435 | /**************************************************************************/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
436 | /*@{*/ |
|
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 | * Registers an IPC command 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 register the command with. |
|
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 func The function to execute. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
444 | * @param marshal The marshalling function. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
445 | * @param ret_value The return value type. |
|
7114
6e5e4e674496
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
7034
diff
changeset
|
446 | * @param num_params The number of parameters. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
447 | * @param ... The parameter types. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
448 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
449 | * @return TRUE if the function was registered successfully, or |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
450 | * FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
451 | */ |
| 15884 | 452 | gboolean purple_plugin_ipc_register(PurplePlugin *plugin, const char *command, |
| 453 | PurpleCallback func, | |
| 454 | PurpleSignalMarshalFunc marshal, | |
| 455 | PurpleValue *ret_value, int num_params, ...); | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
456 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
457 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
458 | * Unregisters an IPC command in a plugin. |
|
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 | * @param plugin The plugin to unregister the command from. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
461 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
462 | */ |
| 15884 | 463 | void purple_plugin_ipc_unregister(PurplePlugin *plugin, const char *command); |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
464 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
465 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
466 | * Unregisters all IPC commands in a plugin. |
|
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 | * @param plugin The plugin to unregister the commands from. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
469 | */ |
| 15884 | 470 | void purple_plugin_ipc_unregister_all(PurplePlugin *plugin); |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
471 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
472 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
473 | * Returns a list of value types used for an IPC command. |
|
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 | * @param plugin The plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
476 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
477 | * @param ret_value The returned return value. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
478 | * @param num_params The returned number of parameters. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
479 | * @param params The returned list of parameters. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
480 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
481 | * @return TRUE if the command was found, or FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
482 | */ |
| 15884 | 483 | gboolean purple_plugin_ipc_get_params(PurplePlugin *plugin, const char *command, |
| 484 | PurpleValue **ret_value, int *num_params, | |
| 485 | PurpleValue ***params); | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
486 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
487 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
488 | * Executes an IPC command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
489 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
490 | * @param plugin The plugin to execute the command on. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
491 | * @param command The name of the command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
492 | * @param ok TRUE if the call was successful, or FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
493 | * @param ... The parameters to pass. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
494 | * |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
495 | * @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
|
496 | * return a value. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
497 | */ |
| 15884 | 498 | void *purple_plugin_ipc_call(PurplePlugin *plugin, const char *command, |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
499 | gboolean *ok, ...); |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
500 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
501 | /*@}*/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
502 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
503 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
504 | /** @name Plugins API */ |
| 5205 | 505 | /**************************************************************************/ |
| 506 | /*@{*/ | |
| 507 | ||
| 508 | /** | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
509 | * Add a new directory to search for plugins |
| 5205 | 510 | * |
|
10448
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
511 | * @param path The new search path. |
| 5205 | 512 | */ |
| 15884 | 513 | void purple_plugins_add_search_path(const char *path); |
| 5205 | 514 | |
| 515 | /** | |
|
27583
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
516 | * Returns a list of plugin search paths. |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
517 | * |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
518 | * @constreturn A list of searched paths. |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
519 | * |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
520 | * @since 2.6.0 |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
521 | */ |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
522 | GList *purple_plugins_get_search_paths(void); |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
523 | |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
524 | /** |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
525 | * Unloads all loaded plugins. |
| 5205 | 526 | */ |
| 15884 | 527 | void purple_plugins_unload_all(void); |
| 5205 | 528 | |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
529 | /** |
|
26751
4b0dffa16ffe
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26726
diff
changeset
|
530 | * Unloads all plugins of a specific type. |
|
4b0dffa16ffe
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26726
diff
changeset
|
531 | */ |
|
4b0dffa16ffe
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26726
diff
changeset
|
532 | void purple_plugins_unload(PurplePluginType type); |
|
4b0dffa16ffe
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26726
diff
changeset
|
533 | |
|
4b0dffa16ffe
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26726
diff
changeset
|
534 | /** |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
535 | * Destroys all registered plugins. |
|
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
536 | */ |
| 15884 | 537 | void purple_plugins_destroy_all(void); |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
538 | |
| 5205 | 539 | /** |
| 15357 | 540 | * Saves the list of loaded plugins to the specified preference key |
| 541 | * | |
| 542 | * @param key The preference key to save the list of plugins to. | |
| 543 | */ | |
| 15884 | 544 | void purple_plugins_save_loaded(const char *key); |
| 15357 | 545 | |
| 546 | /** | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
547 | * Attempts to load all the plugins in the specified preference key |
| 15884 | 548 | * that were loaded when purple last quit. |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
549 | * |
|
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
550 | * @param key The preference key containing the list of plugins. |
| 5838 | 551 | */ |
| 15884 | 552 | void purple_plugins_load_saved(const char *key); |
| 5838 | 553 | |
| 554 | /** | |
| 5205 | 555 | * Probes for plugins in the registered module paths. |
| 556 | * | |
| 557 | * @param ext The extension type to probe for, or @c NULL for all. | |
| 558 | * | |
| 15884 | 559 | * @see purple_plugin_set_probe_path() |
| 5205 | 560 | */ |
| 15884 | 561 | void purple_plugins_probe(const char *ext); |
| 5205 | 562 | |
| 563 | /** | |
| 564 | * Returns whether or not plugin support is enabled. | |
| 565 | * | |
| 566 | * @return TRUE if plugin support is enabled, or FALSE otherwise. | |
| 567 | */ | |
| 15884 | 568 | gboolean purple_plugins_enabled(void); |
| 5205 | 569 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
570 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 571 | /** |
| 572 | * Registers a function that will be called when probing is finished. | |
| 573 | * | |
| 574 | * @param func The callback function. | |
| 575 | * @param data Data to pass to the callback. | |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
576 | * @deprecated If you need this, ask for a plugin-probe signal to be added. |
| 5205 | 577 | */ |
| 15884 | 578 | void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
579 | #endif |
| 5205 | 580 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
581 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 582 | /** |
| 583 | * Unregisters a function that would be called when probing is finished. | |
| 584 | * | |
| 585 | * @param func The callback function. | |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
586 | * @deprecated If you need this, ask for a plugin-probe signal to be added. |
| 5205 | 587 | */ |
| 15884 | 588 | void purple_plugins_unregister_probe_notify_cb(void (*func)(void *)); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
589 | #endif |
| 5205 | 590 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
591 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 592 | /** |
| 593 | * Registers a function that will be called when a plugin is loaded. | |
| 594 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
595 | * @param func The callback function. |
| 5205 | 596 | * @param data Data to pass to the callback. |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
597 | * @deprecated Use the plugin-load signal instead. |
| 5205 | 598 | */ |
| 15884 | 599 | void purple_plugins_register_load_notify_cb(void (*func)(PurplePlugin *, void *), |
| 5205 | 600 | void *data); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
601 | #endif |
| 5205 | 602 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
603 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 604 | /** |
| 605 | * Unregisters a function that would be called when a plugin is loaded. | |
| 606 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
607 | * @param func The callback function. |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
608 | * @deprecated Use the plugin-load signal instead. |
| 5205 | 609 | */ |
| 15884 | 610 | void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *)); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
611 | #endif |
| 5205 | 612 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
613 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 614 | /** |
| 615 | * Registers a function that will be called when a plugin is unloaded. | |
| 616 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
617 | * @param func The callback function. |
| 5205 | 618 | * @param data Data to pass to the callback. |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
619 | * @deprecated Use the plugin-unload signal instead. |
| 5205 | 620 | */ |
| 15884 | 621 | void purple_plugins_register_unload_notify_cb(void (*func)(PurplePlugin *, void *), |
| 5205 | 622 | void *data); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
623 | #endif |
| 5205 | 624 | |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
23859
diff
changeset
|
625 | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_) |
| 5205 | 626 | /** |
| 627 | * Unregisters a function that would be called when a plugin is unloaded. | |
| 628 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8713
diff
changeset
|
629 | * @param func The callback function. |
|
20807
e9749eea6a46
Deprecate the purple_plugins_register_* and purple_plugins_unregister_* functions. We have plugin-load and plugin-unload signals.
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
630 | * @deprecated Use the plugin-unload signal instead. |
| 5205 | 631 | */ |
| 15884 | 632 | void purple_plugins_unregister_unload_notify_cb(void (*func)(PurplePlugin *, |
| 5205 | 633 | void *)); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20807
diff
changeset
|
634 | #endif |
| 5205 | 635 | |
| 636 | /** | |
| 637 | * Finds a plugin with the specified name. | |
| 638 | * | |
| 639 | * @param name The plugin name. | |
| 640 | * | |
| 641 | * @return The plugin if found, or @c NULL if not found. | |
| 642 | */ | |
| 15884 | 643 | PurplePlugin *purple_plugins_find_with_name(const char *name); |
| 5205 | 644 | |
| 645 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
646 | * Finds a plugin with the specified filename (filename with a path). |
| 5205 | 647 | * |
| 648 | * @param filename The plugin filename. | |
| 649 | * | |
| 650 | * @return The plugin if found, or @c NULL if not found. | |
| 651 | */ | |
| 15884 | 652 | PurplePlugin *purple_plugins_find_with_filename(const char *filename); |
| 5205 | 653 | |
| 654 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
655 | * 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
|
656 | * |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
657 | * @param basename The plugin basename. |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
658 | * |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
659 | * @return The plugin if found, or @c NULL if not found. |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
660 | */ |
| 15884 | 661 | PurplePlugin *purple_plugins_find_with_basename(const char *basename); |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
662 | |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
663 | /** |
| 5205 | 664 | * Finds a plugin with the specified plugin ID. |
| 665 | * | |
| 666 | * @param id The plugin ID. | |
| 667 | * | |
| 668 | * @return The plugin if found, or @c NULL if not found. | |
| 669 | */ | |
| 15884 | 670 | PurplePlugin *purple_plugins_find_with_id(const char *id); |
| 5205 | 671 | |
| 672 | /** | |
| 673 | * Returns a list of all loaded plugins. | |
| 674 | * | |
|
20971
b5e1eb080f33
Replace a bunch of @return markers with @constreturn markers. I believe these
Etan Reisner <deryni@pidgin.im>
parents:
20889
diff
changeset
|
675 | * @constreturn A list of all loaded plugins. |
| 5205 | 676 | */ |
| 15884 | 677 | GList *purple_plugins_get_loaded(void); |
| 5205 | 678 | |
| 679 | /** | |
|
11950
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
680 | * Returns a list of all valid protocol plugins. A protocol |
|
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
681 | * plugin is considered invalid if it does not contain the call |
| 15884 | 682 | * 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
|
683 | * against an incompatable API version. |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
684 | * |
|
20971
b5e1eb080f33
Replace a bunch of @return markers with @constreturn markers. I believe these
Etan Reisner <deryni@pidgin.im>
parents:
20889
diff
changeset
|
685 | * @constreturn A list of all protocol plugins. |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
686 | */ |
| 15884 | 687 | GList *purple_plugins_get_protocols(void); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
688 | |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
689 | /** |
| 5205 | 690 | * Returns a list of all plugins, whether loaded or not. |
| 691 | * | |
|
20971
b5e1eb080f33
Replace a bunch of @return markers with @constreturn markers. I believe these
Etan Reisner <deryni@pidgin.im>
parents:
20889
diff
changeset
|
692 | * @constreturn A list of all plugins. |
| 5205 | 693 | */ |
| 15884 | 694 | GList *purple_plugins_get_all(void); |
| 5205 | 695 | |
| 696 | /*@}*/ | |
| 697 | ||
| 10479 | 698 | /**************************************************************************/ |
| 699 | /** @name Plugins SubSytem API */ | |
| 700 | /**************************************************************************/ | |
| 701 | /*@{*/ | |
| 702 | ||
| 703 | /** | |
| 704 | * Returns the plugin subsystem handle. | |
| 705 | * | |
| 706 | * @return The plugin sybsystem handle. | |
| 707 | */ | |
| 15884 | 708 | void *purple_plugins_get_handle(void); |
| 10479 | 709 | |
| 710 | /** | |
| 711 | * Initializes the plugin subsystem | |
| 712 | */ | |
| 15884 | 713 | void purple_plugins_init(void); |
| 10479 | 714 | |
| 715 | /** | |
| 716 | * Uninitializes the plugin subsystem | |
| 717 | */ | |
| 15884 | 718 | void purple_plugins_uninit(void); |
| 10479 | 719 | |
| 720 | /*@}*/ | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
721 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
722 | /** |
| 15884 | 723 | * Allocates and returns a new PurplePluginAction. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
724 | * |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
725 | * @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
|
726 | * @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
|
727 | */ |
| 15884 | 728 | 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
|
729 | |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
730 | /** |
| 15884 | 731 | * Frees a PurplePluginAction |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
732 | * |
| 15884 | 733 | * @param action The PurplePluginAction to free. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
734 | */ |
| 15884 | 735 | void purple_plugin_action_free(PurplePluginAction *action); |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
736 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
737 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
738 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
739 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
740 | |
| 15884 | 741 | #endif /* _PURPLE_PLUGIN_H_ */ |