Mercurial > pidgin.yaz
comparison doc/C-HOWTO.dox @ 20470:7d6f247f08d9
propagate from branch 'im.pidgin.pidgin' (head be582d1ac8a250870b9c691a8cb1ab4c170650bc)
to branch 'im.pidgin.cpw.khc.msnp14' (head 02e228232108b82dfaf51b2bd5daabeab692c0b0)
author | Carlos Silva <typ0@pidgin.im> |
---|---|
date | Mon, 16 Jul 2007 23:06:21 +0000 |
parents | 52f3e904a250 |
children | e0613cf8c493 |
comparison
equal
deleted
inserted
replaced
20469:9e5bb492fc18 | 20470:7d6f247f08d9 |
---|---|
61 NULL, | 61 NULL, |
62 | 62 |
63 NULL, | 63 NULL, |
64 NULL, | 64 NULL, |
65 NULL, | 65 NULL, |
66 NULL, | |
67 NULL, | |
68 NULL, | |
69 NULL, | |
66 NULL | 70 NULL |
67 }; | 71 }; |
68 | 72 |
69 static void | 73 static void |
70 init_plugin(PurplePlugin *plugin) | 74 init_plugin(PurplePlugin *plugin) |
84 @c PURPLE_PLUGIN_MAGIC, and @c PURPLE_INIT_PLUGIN(). | 88 @c PURPLE_PLUGIN_MAGIC, and @c PURPLE_INIT_PLUGIN(). |
85 | 89 |
86 Our last include is version.h which defines @c PURPLE_MAJOR_VERSION, and | 90 Our last include is version.h which defines @c PURPLE_MAJOR_VERSION, and |
87 @c PURPLE_MINOR_VERSION. There is not much you need to know about these, | 91 @c PURPLE_MINOR_VERSION. There is not much you need to know about these, |
88 except that they are required and will stop your plugin from crashing Pidgin | 92 except that they are required and will stop your plugin from crashing Pidgin |
89 when something has changed that you plugin does not know about yet. | 93 when something has changed that your plugin does not know about yet. |
90 | 94 |
91 plugin_load is not required. It is called when the plugin is loaded so that | 95 @c plugin_load is not required. It is called when the plugin is loaded so |
92 you can initialize any variables and so on. But in this plugin we'll just | 96 that you can initialize any variables and so on. In this plugin we'll just |
93 use it to display a message. | 97 use it to display a message. |
94 | 98 |
95 Next we have the @c PurplePluginInfo structure. Every plugin MUST have one of | 99 Next we have the @c PurplePluginInfo structure. Every plugin MUST have one of |
96 these. Below is a code snipet of the same struct used in @c hello_world with | 100 these. Below is a code snipet of the same struct used in @c hello_world with |
97 comments describing what each is. | 101 comments describing what each is. |
223 core plugins to have a UI configuration | 227 core plugins to have a UI configuration |
224 frame. You can find an example of this | 228 frame. You can find an example of this |
225 code in: | 229 code in: |
226 libpurple/plugins/pluginpref_example.c | 230 libpurple/plugins/pluginpref_example.c |
227 */ | 231 */ |
228 NULL /* Finally, the last member of the structure | 232 NULL, /* This is a function pointer where you can define |
229 is a function pointer where you can define | |
230 "plugin actions". The UI controls how | 233 "plugin actions". The UI controls how |
231 they're displayed. It should be of the | 234 they're displayed. It should be of the |
232 type: | 235 type: |
233 | 236 |
234 GList *function_name(PurplePlugin *plugin, | 237 GList *function_name(PurplePlugin *plugin, |
235 gpointer context) | 238 gpointer context) |
236 | 239 |
237 It must return a GList of | 240 It must return a GList of |
238 PurplePluginActions. | 241 PurplePluginActions. |
239 */ | 242 */ |
243 NULL, /* This is a pointer reserved for future use. | |
244 We set it to NULL to indicate we don't | |
245 need it. | |
246 */ | |
247 NULL, /* This is a pointer reserved for future use. | |
248 We set it to NULL to indicate we don't | |
249 need it. | |
250 */ | |
251 NULL, /* This is a pointer reserved for future use. | |
252 We set it to NULL to indicate we don't | |
253 need it. | |
254 */ | |
255 NULL /* This is a pointer reserved for future use. | |
256 We set it to NULL to indicate we don't | |
257 need it. | |
258 */ | |
240 }; | 259 }; |
241 @endcode | 260 @endcode |
242 | 261 |
243 Finally we have @c init_plugin and @c PURPLE_INIT_PLUGIN. @c init_plugin is | 262 Finally we have @c init_plugin and @c PURPLE_INIT_PLUGIN. @c init_plugin is |
244 a function that gets called when libpurple probes the plugin. Most plugins | 263 a function that gets called when libpurple probes the plugin. Most plugins |