Fri, 31 Jan 2014 18:44:42 +0530
Use 'transfer none' for TODO const
| 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" |
| 5205 | 35 | |
| 34783 | 36 | /** Returns the GType for the PurplePlugin boxed structure */ |
| 37 | #define PURPLE_TYPE_PLUGIN (purple_plugin_get_type()) | |
| 5205 | 38 | |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
39 | /** @copydoc _PurplePlugin */ |
| 15884 | 40 | 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
|
41 | /** @copydoc _PurplePluginInfo */ |
| 15884 | 42 | 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
|
43 | /** @copydoc _PurplePluginUiInfo */ |
| 15884 | 44 | 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
|
45 | /** @copydoc _PurplePluginLoaderInfo */ |
| 15884 | 46 | typedef struct _PurplePluginLoaderInfo PurplePluginLoaderInfo; |
| 5205 | 47 | |
|
25630
f9fb8da4b5ec
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <deryni@pidgin.im>
parents:
24569
diff
changeset
|
48 | /** @copydoc _PurplePluginAction */ |
| 15884 | 49 | typedef struct _PurplePluginAction PurplePluginAction; |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
50 | |
| 15884 | 51 | typedef int PurplePluginPriority; /**< Plugin priority. */ |
| 5205 | 52 | |
| 8713 | 53 | #include "pluginpref.h" |
| 54 | ||
| 5205 | 55 | /** |
| 56 | * Plugin types. | |
| 57 | */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
58 | typedef enum |
| 5205 | 59 | { |
| 15884 | 60 | PURPLE_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ |
| 61 | PURPLE_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
| 62 | PURPLE_PLUGIN_LOADER, /**< Loader plugin. */ | |
| 63 | PURPLE_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
64 | |
| 15884 | 65 | } PurplePluginType; |
| 5205 | 66 | |
| 15884 | 67 | #define PURPLE_PRIORITY_DEFAULT 0 |
| 68 | #define PURPLE_PRIORITY_HIGHEST 9999 | |
| 69 | #define PURPLE_PRIORITY_LOWEST -9999 | |
| 5205 | 70 | |
| 15884 | 71 | #define PURPLE_PLUGIN_FLAG_INVISIBLE 0x01 |
|
6928
17e0c572bd97
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
72 | |
| 15884 | 73 | #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
|
74 | |
| 5205 | 75 | /** |
| 76 | * Detailed information about a plugin. | |
| 77 | * | |
| 78 | * This is used in the version 2.0 API and up. | |
| 79 | */ | |
| 15884 | 80 | struct _PurplePluginInfo |
| 5205 | 81 | { |
| 9943 | 82 | unsigned int magic; |
| 83 | unsigned int major_version; | |
| 84 | unsigned int minor_version; | |
| 15884 | 85 | PurplePluginType type; |
| 5205 | 86 | char *ui_requirement; |
| 87 | unsigned long flags; | |
| 88 | GList *dependencies; | |
| 15884 | 89 | PurplePluginPriority priority; |
| 5205 | 90 | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
91 | const char *id; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
92 | const char *name; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
93 | const char *version; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
94 | const char *summary; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
95 | const char *description; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
96 | const char *author; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32787
diff
changeset
|
97 | const char *homepage; |
| 5205 | 98 | |
|
11963
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
99 | /** |
|
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
100 | * If a plugin defines a 'load' function, and it returns FALSE, |
|
3af2d2a60564
[gaim-migrate @ 14254]
Mark Doliner <markdoliner@pidgin.im>
parents:
11950
diff
changeset
|
101 | * then the plugin will not be loaded. |
|
10450
1757208151dc
[gaim-migrate @ 11715]
Mark Doliner <markdoliner@pidgin.im>
parents:
10448
diff
changeset
|
102 | */ |
| 15884 | 103 | gboolean (*load)(PurplePlugin *plugin); |
| 104 | gboolean (*unload)(PurplePlugin *plugin); | |
| 105 | void (*destroy)(PurplePlugin *plugin); | |
| 5205 | 106 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11772
diff
changeset
|
107 | void *ui_info; /**< Used only by UI-specific plugins to build a preference screen with a custom UI */ |
| 5205 | 108 | void *extra_info; |
| 15884 | 109 | 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
|
110 | |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
111 | /** |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
112 | * 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
|
113 | * 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
|
114 | * |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
115 | * 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
|
116 | * 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
|
117 | * context will be NULL. |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
118 | * |
|
ad976a772a6d
Document this callback function. Prompted by a question in #pidgin
Mark Doliner <markdoliner@pidgin.im>
parents:
26751
diff
changeset
|
119 | * 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
|
120 | * 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
|
121 | * 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
|
122 | * 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
|
123 | */ |
| 15884 | 124 | 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
|
125 | |
|
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_reserved1)(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_reserved2)(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_reserved3)(void); |
|
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_reserved4)(void); |
| 5205 | 130 | }; |
| 131 | ||
| 132 | /** | |
| 133 | * Extra information for loader plugins. | |
| 134 | */ | |
| 15884 | 135 | struct _PurplePluginLoaderInfo |
| 5205 | 136 | { |
| 137 | GList *exts; | |
| 138 | ||
| 15884 | 139 | gboolean (*probe)(PurplePlugin *plugin); |
| 140 | gboolean (*load)(PurplePlugin *plugin); | |
| 141 | gboolean (*unload)(PurplePlugin *plugin); | |
| 142 | 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
|
143 | |
|
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_reserved1)(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_reserved2)(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_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
147 | void (*_purple_reserved4)(void); |
| 5205 | 148 | }; |
| 149 | ||
| 150 | /** | |
| 151 | * A plugin handle. | |
| 152 | */ | |
| 15884 | 153 | struct _PurplePlugin |
| 5205 | 154 | { |
| 155 | gboolean native_plugin; /**< Native C plugin. */ | |
| 156 | gboolean loaded; /**< The loaded state. */ | |
| 157 | void *handle; /**< The module handle. */ | |
| 158 | char *path; /**< The path to the plugin. */ | |
| 15884 | 159 | PurplePluginInfo *info; /**< The plugin information. */ |
| 5205 | 160 | char *error; |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
161 | void *ipc_data; /**< IPC data. */ |
| 5205 | 162 | void *extra; /**< Plugin-specific data. */ |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
163 | gboolean unloadable; /**< Unloadable */ |
| 12926 | 164 | GList *dependent_plugins; /**< Plugins depending on this */ |
|
34477
86f6c431da7b
Hide some reserved plugin fields
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34173
diff
changeset
|
165 | gpointer ui_data; /**< The UI data. */ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
166 | |
|
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_reserved1)(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_reserved2)(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_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
170 | void (*_purple_reserved4)(void); |
| 5205 | 171 | }; |
| 172 | ||
| 15884 | 173 | #define PURPLE_PLUGIN_LOADER_INFO(plugin) \ |
| 174 | ((PurplePluginLoaderInfo *)(plugin)->info->extra_info) | |
| 5205 | 175 | |
| 15884 | 176 | struct _PurplePluginUiInfo { |
| 177 | PurplePluginPrefFrame *(*get_plugin_pref_frame)(PurplePlugin *plugin); | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
178 | gpointer (*get_plugin_pref_request)(PurplePlugin *plugin); |
| 8713 | 179 | |
|
16743
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 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
243 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
244 | |
| 5205 | 245 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
246 | /** @name Plugin API */ |
| 5205 | 247 | /**************************************************************************/ |
| 248 | /*@{*/ | |
| 249 | ||
| 250 | /** | |
| 34783 | 251 | * Returns the GType for the PurplePlugin boxed structure. |
| 252 | * TODO Boxing of PurplePlugin is a temporary solution to having a GType for | |
| 253 | * plugins. This should rather be a GObject instead of a GBoxed. | |
| 254 | */ | |
| 255 | GType purple_plugin_get_type(void); | |
| 256 | ||
| 257 | /** | |
| 5205 | 258 | * Creates a new plugin structure. |
| 259 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
260 | * @native: Whether or not the plugin is native. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
261 | * @path: The path to the plugin, or %NULL if statically compiled. |
| 5205 | 262 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
263 | * Returns: A new PurplePlugin structure. |
| 5205 | 264 | */ |
| 15884 | 265 | PurplePlugin *purple_plugin_new(gboolean native, const char *path); |
| 5205 | 266 | |
| 267 | /** | |
| 268 | * Probes a plugin, retrieving the information on it and adding it to the | |
| 269 | * list of available plugins. | |
| 270 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
271 | * @filename: The plugin's filename. |
| 5205 | 272 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
273 | * Returns: The plugin handle. |
| 5205 | 274 | * |
| 15884 | 275 | * @see purple_plugin_load() |
| 276 | * @see purple_plugin_destroy() | |
| 5205 | 277 | */ |
| 15884 | 278 | PurplePlugin *purple_plugin_probe(const char *filename); |
| 5205 | 279 | |
| 280 | /** | |
| 281 | * Registers a plugin and prepares it for loading. | |
| 282 | * | |
| 283 | * This shouldn't be called by anything but the internal module code. | |
| 15884 | 284 | * 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
|
285 | * with the core. |
| 5205 | 286 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
287 | * @plugin: The plugin to register. |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
288 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
289 | * Returns: %TRUE if the plugin was registered successfully. Otherwise |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
290 | * %FALSE is returned (this happens if the plugin does not contain |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
291 | * the necessary information). |
| 5205 | 292 | */ |
| 15884 | 293 | gboolean purple_plugin_register(PurplePlugin *plugin); |
| 5205 | 294 | |
| 295 | /** | |
| 296 | * Attempts to load a previously probed plugin. | |
| 297 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
298 | * @plugin: The plugin to load. |
| 5205 | 299 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
300 | * Returns: %TRUE if successful, or %FALSE otherwise. |
| 5205 | 301 | * |
| 15884 | 302 | * @see purple_plugin_reload() |
| 303 | * @see purple_plugin_unload() | |
| 5205 | 304 | */ |
| 15884 | 305 | gboolean purple_plugin_load(PurplePlugin *plugin); |
| 5205 | 306 | |
| 307 | /** | |
| 308 | * Unloads the specified plugin. | |
| 309 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
310 | * @plugin: The plugin handle. |
| 5205 | 311 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
312 | * Returns: %TRUE if successful, or %FALSE otherwise. |
| 5205 | 313 | * |
| 15884 | 314 | * @see purple_plugin_load() |
| 315 | * @see purple_plugin_reload() | |
| 5205 | 316 | */ |
| 15884 | 317 | gboolean purple_plugin_unload(PurplePlugin *plugin); |
| 5205 | 318 | |
| 319 | /** | |
|
20870
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
320 | * 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
|
321 | * |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
322 | * 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
|
323 | * 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
|
324 | * 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
|
325 | * 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
|
326 | */ |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
327 | 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
|
328 | |
|
0a689ca1985e
* Add purple_plugin_disable() to prevent plugins from loading on the next
Richard Laager <rlaager@pidgin.im>
parents:
20866
diff
changeset
|
329 | /** |
| 5205 | 330 | * Reloads a plugin. |
| 331 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
332 | * @plugin: The old plugin handle. |
|
6486
18da8fdbc85b
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
333 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
334 | * Returns: %TRUE if successful, or %FALSE otherwise. |
| 5205 | 335 | * |
| 15884 | 336 | * @see purple_plugin_load() |
| 337 | * @see purple_plugin_unload() | |
| 5205 | 338 | */ |
| 15884 | 339 | gboolean purple_plugin_reload(PurplePlugin *plugin); |
| 5205 | 340 | |
| 341 | /** | |
| 342 | * Unloads a plugin and destroys the structure from memory. | |
| 343 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
344 | * @plugin: The plugin handle. |
| 5205 | 345 | */ |
| 15884 | 346 | void purple_plugin_destroy(PurplePlugin *plugin); |
| 5205 | 347 | |
| 348 | /** | |
| 349 | * Returns whether or not a plugin is currently loaded. | |
| 350 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
351 | * @plugin: The plugin. |
| 5205 | 352 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
353 | * Returns: %TRUE if loaded, or %FALSE otherwise. |
| 5205 | 354 | */ |
| 15884 | 355 | gboolean purple_plugin_is_loaded(const PurplePlugin *plugin); |
| 5205 | 356 | |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
357 | /** |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
358 | * Returns whether or not a plugin is unloadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
359 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
360 | * If this returns %TRUE, the plugin is guaranteed to not |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
361 | * be loadable. However, a return value of %FALSE does not |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
362 | * guarantee the plugin is loadable. |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
363 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
364 | * @plugin: The plugin. |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
365 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
366 | * Returns: %TRUE if the plugin is known to be unloadable,\ |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
367 | * %FALSE otherwise |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
368 | */ |
| 15884 | 369 | gboolean purple_plugin_is_unloadable(const PurplePlugin *plugin); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
370 | |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
371 | /** |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
372 | * Returns a plugin's id. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
373 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
374 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
375 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
376 | * Returns: The plugin's id. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
377 | */ |
| 15884 | 378 | const gchar *purple_plugin_get_id(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
381 | * Returns a plugin's name. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
382 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
383 | * @plugin: The plugin. |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
24569
diff
changeset
|
384 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
385 | * Returns: THe name of the plugin, or %NULL. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
386 | */ |
| 15884 | 387 | const gchar *purple_plugin_get_name(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
390 | * Returns a plugin's version. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
391 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
392 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
393 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
394 | * Returns: The plugin's version or %NULL. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
395 | */ |
| 15884 | 396 | const gchar *purple_plugin_get_version(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
399 | * Returns a plugin's summary. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
400 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
401 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
402 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
403 | * Returns: The plugin's summary. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
404 | */ |
| 15884 | 405 | const gchar *purple_plugin_get_summary(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
408 | * Returns a plugin's description. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
409 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
410 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
411 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
412 | * Returns: The plugin's description. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
413 | */ |
| 15884 | 414 | const gchar *purple_plugin_get_description(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
417 | * Returns a plugin's author. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
418 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
419 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
420 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
421 | * Returns: The plugin's author. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
422 | */ |
| 15884 | 423 | const gchar *purple_plugin_get_author(const PurplePlugin *plugin); |
|
11772
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 | /** |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
426 | * Returns a plugin's homepage. |
|
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
427 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
428 | * @plugin: The plugin. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
429 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
430 | * Returns: The plugin's homepage. |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
431 | */ |
| 15884 | 432 | const gchar *purple_plugin_get_homepage(const PurplePlugin *plugin); |
|
11772
0124b31e896a
[gaim-migrate @ 14063]
Gary Kramlich <grim@reaperworld.com>
parents:
10759
diff
changeset
|
433 | |
| 5205 | 434 | /*@}*/ |
| 435 | ||
| 436 | /**************************************************************************/ | |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
437 | /** @name Plugin IPC API */ |
|
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 | /*@{*/ |
|
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 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
442 | * Registers an IPC command in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
443 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
444 | * @plugin: The plugin to register the command with. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
445 | * @command: The name of the command. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
446 | * @func: The function to execute. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
447 | * @marshal: The marshalling function. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
448 | * @ret_type: The return type. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
449 | * @num_params: The number of parameters. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
450 | * @...: The parameter types. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
451 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
452 | * Returns: TRUE if the function was registered successfully, or |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
453 | * FALSE otherwise. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
454 | */ |
| 15884 | 455 | gboolean purple_plugin_ipc_register(PurplePlugin *plugin, const char *command, |
| 456 | PurpleCallback func, | |
| 457 | PurpleSignalMarshalFunc marshal, | |
|
34801
08c49f30e4a1
Replaced PurpleValue with GType in plugin.h, signals.h. Replaced with GValue in status.h.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
458 | GType ret_type, int num_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 | * Unregisters an IPC command in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
462 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
463 | * @plugin: The plugin to unregister the command from. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
464 | * @command: The name of the command. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
465 | */ |
| 15884 | 466 | void purple_plugin_ipc_unregister(PurplePlugin *plugin, const char *command); |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
467 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
468 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
469 | * Unregisters all IPC commands in a plugin. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
470 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
471 | * @plugin: The plugin to unregister the commands from. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
472 | */ |
| 15884 | 473 | void purple_plugin_ipc_unregister_all(PurplePlugin *plugin); |
|
6822
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 | * Returns a list of value types used for an IPC command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
477 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
478 | * @plugin: The plugin. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
479 | * @command: The name of the command. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
480 | * @ret_type: The returned return type. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
481 | * @num_params: The returned number of parameters. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
482 | * @param_types: The returned list of parameter types. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
483 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
484 | * Returns: TRUE if the command was found, or FALSE otherwise. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
485 | */ |
|
34801
08c49f30e4a1
Replaced PurpleValue with GType in plugin.h, signals.h. Replaced with GValue in status.h.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
486 | gboolean purple_plugin_ipc_get_types(PurplePlugin *plugin, const char *command, |
|
08c49f30e4a1
Replaced PurpleValue with GType in plugin.h, signals.h. Replaced with GValue in status.h.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
487 | GType *ret_type, int *num_params, |
|
08c49f30e4a1
Replaced PurpleValue with GType in plugin.h, signals.h. Replaced with GValue in status.h.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
488 | GType **param_types); |
|
6822
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 | /** |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
491 | * Executes an IPC command. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
492 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
493 | * @plugin: The plugin to execute the command on. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
494 | * @command: The name of the command. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
495 | * @ok: TRUE if the call was successful, or FALSE otherwise. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
496 | * @...: The parameters to pass. |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
497 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
498 | * Returns: The return value, which will be NULL if the command doesn't |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
499 | * return a value. |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
500 | */ |
| 15884 | 501 | void *purple_plugin_ipc_call(PurplePlugin *plugin, const char *command, |
|
6822
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
502 | gboolean *ok, ...); |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
503 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
504 | /*@}*/ |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
505 | |
|
4adcde13ad17
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
506 | /**************************************************************************/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
507 | /** @name Plugins API */ |
| 5205 | 508 | /**************************************************************************/ |
| 509 | /*@{*/ | |
| 510 | ||
| 511 | /** | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
9946
diff
changeset
|
512 | * Add a new directory to search for plugins |
| 5205 | 513 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
514 | * @path: The new search path. |
| 5205 | 515 | */ |
| 15884 | 516 | void purple_plugins_add_search_path(const char *path); |
| 5205 | 517 | |
| 518 | /** | |
|
27583
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
519 | * 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
|
520 | * |
|
35394
38facb8226d4
Use 'transfer none' for TODO const
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
521 | * Returns: (transfer none): A list of searched paths. |
|
27583
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
522 | */ |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
523 | 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
|
524 | |
|
616b68fe423f
Add a purple_plugins_get_search_paths function.
Etan Reisner <deryni@pidgin.im>
parents:
26833
diff
changeset
|
525 | /** |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
526 | * Unloads all loaded plugins. |
| 5205 | 527 | */ |
| 15884 | 528 | void purple_plugins_unload_all(void); |
| 5205 | 529 | |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
530 | /** |
|
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
|
531 | * 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
|
532 | */ |
|
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 | 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
|
534 | |
|
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
|
535 | /** |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
536 | * Destroys all registered plugins. |
|
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
537 | */ |
| 15884 | 538 | void purple_plugins_destroy_all(void); |
|
5242
155da5e9bbf0
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
539 | |
| 5205 | 540 | /** |
| 15357 | 541 | * Saves the list of loaded plugins to the specified preference key |
| 542 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
543 | * @key: The preference key to save the list of plugins to. |
| 15357 | 544 | */ |
| 15884 | 545 | void purple_plugins_save_loaded(const char *key); |
| 15357 | 546 | |
| 547 | /** | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
548 | * Attempts to load all the plugins in the specified preference key |
| 15884 | 549 | * that were loaded when purple last quit. |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
550 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
551 | * @key: The preference key containing the list of plugins. |
| 5838 | 552 | */ |
| 15884 | 553 | void purple_plugins_load_saved(const char *key); |
| 5838 | 554 | |
| 555 | /** | |
| 5205 | 556 | * Probes for plugins in the registered module paths. |
| 557 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
558 | * @ext: The extension type to probe for, or %NULL for all. |
| 5205 | 559 | * |
| 15884 | 560 | * @see purple_plugin_set_probe_path() |
| 5205 | 561 | */ |
| 15884 | 562 | void purple_plugins_probe(const char *ext); |
| 5205 | 563 | |
| 564 | /** | |
| 565 | * Returns whether or not plugin support is enabled. | |
| 566 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
567 | * Returns: TRUE if plugin support is enabled, or FALSE otherwise. |
| 5205 | 568 | */ |
| 15884 | 569 | gboolean purple_plugins_enabled(void); |
| 5205 | 570 | |
| 571 | /** | |
| 572 | * Finds a plugin with the specified name. | |
| 573 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
574 | * @name: The plugin name. |
| 5205 | 575 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
576 | * Returns: The plugin if found, or %NULL if not found. |
| 5205 | 577 | */ |
| 15884 | 578 | PurplePlugin *purple_plugins_find_with_name(const char *name); |
| 5205 | 579 | |
| 580 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
581 | * Finds a plugin with the specified filename (filename with a path). |
| 5205 | 582 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
583 | * @filename: The plugin filename. |
| 5205 | 584 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
585 | * Returns: The plugin if found, or %NULL if not found. |
| 5205 | 586 | */ |
| 15884 | 587 | PurplePlugin *purple_plugins_find_with_filename(const char *filename); |
| 5205 | 588 | |
| 589 | /** | |
|
7034
b1d44fe5f072
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
590 | * 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
|
591 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
592 | * @basename: The plugin basename. |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
593 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
594 | * Returns: The plugin if found, or %NULL if not found. |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
595 | */ |
| 15884 | 596 | PurplePlugin *purple_plugins_find_with_basename(const char *basename); |
|
7033
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
597 | |
|
f6096f69a11e
[gaim-migrate @ 7596]
Robert McQueen <robot101@debian.org>
parents:
6928
diff
changeset
|
598 | /** |
| 5205 | 599 | * Finds a plugin with the specified plugin ID. |
| 600 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
601 | * @id: The plugin ID. |
| 5205 | 602 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
603 | * Returns: The plugin if found, or %NULL if not found. |
| 5205 | 604 | */ |
| 15884 | 605 | PurplePlugin *purple_plugins_find_with_id(const char *id); |
| 5205 | 606 | |
| 607 | /** | |
| 608 | * Returns a list of all loaded plugins. | |
| 609 | * | |
|
35394
38facb8226d4
Use 'transfer none' for TODO const
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
610 | * Returns: (transfer none): A list of all loaded plugins. |
| 5205 | 611 | */ |
| 15884 | 612 | GList *purple_plugins_get_loaded(void); |
| 5205 | 613 | |
| 614 | /** | |
|
11950
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
615 | * Returns a list of all valid protocol plugins. A protocol |
|
a522c2da66e5
[gaim-migrate @ 14241]
Evan Schoenberg <evands@pidgin.im>
parents:
11817
diff
changeset
|
616 | * plugin is considered invalid if it does not contain the call |
| 15884 | 617 | * 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
|
618 | * against an incompatable API version. |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
619 | * |
|
35394
38facb8226d4
Use 'transfer none' for TODO const
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
620 | * Returns: (transfer none): A list of all protocol plugins. |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
621 | */ |
| 15884 | 622 | GList *purple_plugins_get_protocols(void); |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
623 | |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
624 | /** |
| 5205 | 625 | * Returns a list of all plugins, whether loaded or not. |
| 626 | * | |
|
35394
38facb8226d4
Use 'transfer none' for TODO const
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
627 | * Returns: (transfer none): A list of all plugins. |
| 5205 | 628 | */ |
| 15884 | 629 | GList *purple_plugins_get_all(void); |
| 5205 | 630 | |
| 631 | /*@}*/ | |
| 632 | ||
| 10479 | 633 | /**************************************************************************/ |
| 634 | /** @name Plugins SubSytem API */ | |
| 635 | /**************************************************************************/ | |
| 636 | /*@{*/ | |
| 637 | ||
| 638 | /** | |
| 639 | * Returns the plugin subsystem handle. | |
| 640 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
641 | * Returns: The plugin sybsystem handle. |
| 10479 | 642 | */ |
| 15884 | 643 | void *purple_plugins_get_handle(void); |
| 10479 | 644 | |
| 645 | /** | |
| 646 | * Initializes the plugin subsystem | |
| 647 | */ | |
| 15884 | 648 | void purple_plugins_init(void); |
| 10479 | 649 | |
| 650 | /** | |
| 651 | * Uninitializes the plugin subsystem | |
| 652 | */ | |
| 15884 | 653 | void purple_plugins_uninit(void); |
| 10479 | 654 | |
| 655 | /*@}*/ | |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
656 | |
|
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
657 | /** |
| 15884 | 658 | * Allocates and returns a new PurplePluginAction. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
659 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
660 | * @label: The description of the action to show to the user. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
661 | * @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
|
662 | */ |
| 15884 | 663 | 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
|
664 | |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
665 | /** |
| 15884 | 666 | * Frees a PurplePluginAction |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
667 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35045
diff
changeset
|
668 | * @action: The PurplePluginAction to free. |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12986
diff
changeset
|
669 | */ |
| 15884 | 670 | void purple_plugin_action_free(PurplePluginAction *action); |
|
9015
3c27e9074fa2
[gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents:
8990
diff
changeset
|
671 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
672 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
673 | |
| 15884 | 674 | #endif /* _PURPLE_PLUGIN_H_ */ |