doc/reference/libpurple/tut_c_plugins.xml

Sat, 14 Jun 2014 00:28:48 +0200

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Sat, 14 Jun 2014 00:28:48 +0200
changeset 36116
e1f9a50effbc
parent 35490
1c4efce838f6
child 37097
aef5930bd889
permissions
-rw-r--r--

Fill comments for PurpleMessage

35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
1 <?xml version='1.0' encoding="ISO-8859-1"?>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
4 ]>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
5 <chapter id="chapter-tut-c-plugins">
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
6 <title>C Plugins tutorial</title>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
7
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
8 <sect2 id="tut-c-plugins-introduction">
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
9 <title>Introduction</title>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
10 <para>
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
11 C plugins are native plugins. They have complete access to all of the API,
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
12 and can do basically whatever they want. All of the protocol plugins are
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
13 also written in C.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
14 </para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
15 </sect2>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
16
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
17 <sect2 id="tut-c-plugins-getting-started">
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
18 <title>Getting Started</title>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
19 <para>
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
20 To develop a plugin you need to have the libpurple and (for UI plugins) the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
21 Pidgin/Finch source code or development headers. It is generally a good idea
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
22 to compile against the same version of Pidgin that you are running. You may
34961
e00be7ef0773 Replaced monotone references with mercurial in docs
Ankit Vani <a@nevitus.org>
parents: 23325
diff changeset
23 also want to develop against the code in our Mercurial repository if you need
e00be7ef0773 Replaced monotone references with mercurial in docs
Ankit Vani <a@nevitus.org>
parents: 23325
diff changeset
24 to use a new feature. Please do not abuse our Mercurial repository, however.
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
25 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
26
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
27 <para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
28 All plugins must have <literal>PURPLE_PLUGINS</literal> defined and the
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
29 definition must be before including any libpurple, Pidgin, or Finch header
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
30 files. Failure to do so can lead to strange errors that are hard to diagnose.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
31 Including <literal>purple.h</literal> will define this for you.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
32 </para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
33 </sect2>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
34
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
35 <sect2 id="tut-c-plugins-hello-world">
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
36 <title>An Example</title>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
37 <para>
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
38 I know every tutorial has a hello world, so why should libpurple be any
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
39 different?
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
40
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
41 <example>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
42 <title>Hello World!</title>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
43 <programlisting>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
44 #include &lt;purple.h&gt;
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
45
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
46 static gboolean
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
47 plugin_load(PurplePlugin *plugin) {
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
48 purple_notify_message(plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!",
34962
d18669b989b6 Updated the hello world example in the docs to use the new notify API
Ankit Vani <a@nevitus.org>
parents: 34961
diff changeset
49 "This is the Hello World! plugin :)",
d18669b989b6 Updated the hello world example in the docs to use the new notify API
Ankit Vani <a@nevitus.org>
parents: 34961
diff changeset
50 NULL, NULL, NULL, NULL);
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
51
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
52 return TRUE;
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
53 }
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
54
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
55 static PurplePluginInfo info = {
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
56 PURPLE_PLUGIN_MAGIC,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
57 PURPLE_MAJOR_VERSION,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
58 PURPLE_MINOR_VERSION,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
59 PURPLE_PLUGIN_STANDARD,
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
60 NULL,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
61 0,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
62 NULL,
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
63 PURPLE_PRIORITY_DEFAULT,
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
64
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
65 "core-hello_world",
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
66 "Hello World!",
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
67 VERSION,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
68
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
69 "Hello World Plugin",
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
70 "Hello World Plugin",
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
71 NULL,
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
72 "http://helloworld.tld",
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
73
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
74 plugin_load,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
75 NULL,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
76 NULL,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
77
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
78 NULL,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
79 NULL,
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
80 NULL,
18789
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
81 NULL,
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
82 NULL,
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
83 NULL,
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
84 NULL,
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
85 NULL
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
86 };
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
87
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
88 static void
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
89 init_plugin(PurplePlugin *plugin)
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
90 {
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
91 }
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
92
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
93 PURPLE_INIT_PLUGIN(hello_world, init_plugin, info);
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
94 </programlisting>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
95 </example>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
96 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
97
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
98 <para>
34964
54ebd3dcae16 Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents: 34962
diff changeset
99 Okay, so what does all this mean? We start off by including purple.h. This
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
100 file defines <literal>PURPLE_PLUGINS</literal> as described before so that we
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
101 don't have to manually define it. It also includes all the libpurple header
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
102 files.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
103 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
104
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
105 <para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
106 <literal>plugin_load</literal> is not required. It is called when the plugin
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
107 is loaded so that you can initialize any variables and so on. In this plugin
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
108 we'll just use it to display a message.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
109 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
110
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
111 <para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
112 Next we have the <literal>PurplePluginInfo</literal> structure. Every plugin
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
113 <emphasis>MUST</emphasis> have one of these. Below is a code snipet of the
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
114 same struct used in <literal>hello_world</literal> with comments describing
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
115 what each is.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
116 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
117
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
118 <para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
119 <programlisting>
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
120 static PurplePluginInfo info = {
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
121 PURPLE_PLUGIN_MAGIC, /* Plugin magic, this must always be
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
122 PURPLE_PLUGIN_MAGIC.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
123 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
124 PURPLE_MAJOR_VERSION, /* This is also defined in libpurple. It helps
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
125 libpurple's plugin system determine which
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
126 version of libpurple this plugin was
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
127 compiled for, and whether loading it will
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
128 cause problems.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
129 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
130 PURPLE_MINOR_VERSION, /* See previous */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
131 PURPLE_PLUGIN_STANDARD, /* PurplePluginType: There are 4 different
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
132 values for this field. The first is
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
133 PURPLE_PLUGIN_UNKNOWN, which should not be
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
134 used. The second is PURPLE_PLUGIN_STANDARD;
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
135 this is the value most plugins will use.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
136 Next, we have PURPLE_PLUGIN_LOADER; this is
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
137 the type you want to load if your plugin
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
138 is going to make it possible to load non-
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
139 native plugins. For example, the Perl and
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
140 Tcl loader plugins are of this type.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
141 Last, we have PURPLE_PLUGIN_PROTOCOL. If
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
142 your plugin is going to allow the user to
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
143 connect to another network, this is the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
144 type you'd want to use.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
145 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
146 NULL, /* This field is the UI requirement. If you're
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
147 writing a core plugin, this must be NULL
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
148 and the plugin must not contain any UI
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
149 code. If you're writing a Pidgin plugin,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
150 you need to use PIDGIN_PLUGIN_TYPE. If you
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
151 are writing a Finch plugin, you would use
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
152 FINCH_PLUGIN_TYPE.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
153 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
154 0, /* This field is for plugin flags. Currently,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
155 the only flag available to plugins is
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
156 invisible (PURPLE_PLUGIN_FLAG_INVISIBLE).
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
157 It causes the plugin to NOT appear in the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
158 list of plugins.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
159 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
160 NULL, /* This is a GList of plugin dependencies. In
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
161 other words, a GList of plugin id's that
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
162 your plugin depends on. Set this value to
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
163 NULL no matter what. If your plugin has
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
164 dependencies, set them at run-time in the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
165 plugin_init function.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
166 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
167 PURPLE_PRIORITY_DEFAULT,/* This is the priority libpurple with give your
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
168 plugin. There are three possible values
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
169 for this field, PURPLE_PRIORITY_DEFAULT,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
170 PURPLE_PRIORITY_HIGHEST, and
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
171 PURPLE_PRIORITY_LOWEST
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
172 */
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
173
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
174 "core-hello_world", /* This is your plugin's id. There is a whole
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
175 page dedicated to this in the Related Pages
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
176 section of the API docs.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
177 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
178 "Hello World!", /* This is your plugin's name. This is what
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
179 will be displayed for your plugin in the UI.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
180 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
181 1.1, /* This is the version of your plugin. */
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
182
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
183 "Hello World Plugin", /* This is the summary of your plugin. It
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
184 should be a short little blurb. The UI
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
185 determines where, if at all, to display
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
186 this.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
187 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
188 "Hello World Plugin", /* This is the description of your plugin. It
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
189 can be as long and as descriptive as you
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
190 like. And like the summary, it's up to the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
191 UI where, if at all, to display this (and
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
192 how much to display).
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
193 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
194 NULL, /* This is where you can put your name and
23325
a374a26fe217 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents: 20897
diff changeset
195 email address.
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
196 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
197 "http://helloworld.tld",/* This is the website for the plugin. This
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
198 tells users where to find new versions,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
199 report bugs, etc.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
200 */
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
201
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
202 plugin_load, /* This is a pointer to a function for
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
203 libpurple to call when it is loading the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
204 plugin. It should be of the type:
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
205
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
206 gboolean plugin_load(PurplePlugin *plugin)
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
207
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
208 Returning FALSE will stop the loading of the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
209 plugin. Anything else would evaluate as
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
210 TRUE and the plugin will continue to load.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
211 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
212 NULL, /* Same as above except it is called when
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
213 libpurple tries to unload your plugin. It
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
214 should be of the type:
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
215
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
216 gboolean plugin_unload(PurplePlugin *plugin)
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
217
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
218 Returning TRUE will tell libpurple to
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
219 continue unloading while FALSE will stop
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
220 the unloading of your plugin.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
221 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
222 NULL, /* Similar to the two above members, except
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
223 this is called when libpurple tries to
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
224 destory the plugin. This is generally only
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
225 called when for some reason or another the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
226 plugin fails to probe correctly. It should
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
227 be of the type:
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
228
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
229 void plugin_destroy(PurplePlugin *plugin)
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
230 */
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
231
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
232 NULL, /* This is a pointer to a UI-specific struct.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
233 For a Pidgin plugin it will be a pointer to a
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
234 PidginPluginUiInfo struct, for example.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
235 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
236 NULL, /* This is a pointer to either a
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
237 PurplePluginLoaderInfo struct or a
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
238 PurplePluginProtocolInfo struct, and is
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
239 beyond the scope of this document.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
240 */
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
241 NULL, /* This is a pointer to a PurplePluginUiInfo
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
242 struct. It is a core/ui split way for
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
243 core plugins to have a UI configuration
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
244 frame. You can find an example of this
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
245 code in:
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
246 libpurple/plugins/pluginpref_example.c
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
247 */
18789
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
248 NULL, /* This is a function pointer where you can define
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
249 "plugin actions". The UI controls how
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
250 they're displayed. It should be of the
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
251 type:
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
252
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
253 GList *function_name(PurplePlugin *plugin,
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
254 gpointer context)
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
255
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
256 It must return a GList of
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
257 PurplePluginActions.
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
258 */
18789
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
259 NULL, /* This is a pointer reserved for future use.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
260 We set it to NULL to indicate we don't
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
261 need it.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
262 */
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
263 NULL, /* This is a pointer reserved for future use.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
264 We set it to NULL to indicate we don't
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
265 need it.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
266 */
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
267 NULL, /* This is a pointer reserved for future use.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
268 We set it to NULL to indicate we don't
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
269 need it.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
270 */
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
271 NULL /* This is a pointer reserved for future use.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
272 We set it to NULL to indicate we don't
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
273 need it.
f7a51d12abc0 Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16260
diff changeset
274 */
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
275 };
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
276 </programlisting>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
277 </para>
10468
a991d3324b36 [gaim-migrate @ 11750]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
278
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
279 <para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
280 Finally we have <literal>init_plugin</literal> and
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
281 <literal>PURPLE_INIT_PLUGIN</literal>. <literal>init_plugin</literal> is
16260
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
282 a function that gets called when libpurple probes the plugin. Most plugins
3e2e3df543f0 Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents: 15864
diff changeset
283 will add their preferences to the pref tree here--more about that later.
35490
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
284 <literal>PURPLE_INIT_PLUGIN</literal> is a macro that EVERY plugin MUST have.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
285 <literal>PURPLE_INIT_PLUGIN</literal> tells libpurple some very basic things
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
286 about your plugin, like what name to use if the plugin is compiled staticly,
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
287 the <literal>init_plugin</literal> function, and the name of the
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
288 <literal>PurplePluginInfo</literal> structure. As you may have guessed,
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
289 this also gets read when libpurple is probing your plugin. If this is
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
290 missing, the plugin will not load.
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
291 </para>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
292 </sect2>
1c4efce838f6 gtk-doc-ify C-HOWTO, plugin-i18n, plugin-ids, plugin-signals
Ankit Vani <a@nevitus.org>
parents: 34964
diff changeset
293 </chapter>

mercurial