Fri, 06 Dec 2013 01:06:45 -0800
Remove the "existing window" option for where to open URLs.
This was kind of a dumb option. I mean, who would want that?
We didn't support it in Chrome. We attempted to support it in
Firefox, Netscape and Opera.
It actually caused my Pidgin to hang when I tested it with Firefox.
I'm sure it's fixable, but who cares? Here's the stacktrace, for the
curious:
#0 0x00007f5c461a8fbd in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007f5c470be1dc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007f5c470be6ba in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007f5c470ffe41 in g_spawn_sync () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007f5c471002b8 in g_spawn_command_line_sync () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00000000004ae804 in uri_command (command=0x203e760 "firefox -a firefox -remote openURL('http://www.yahoo.com/')",
sync=1) at gtknotify.c:1270
| 10468 | 1 | /** @page c-howto C Plugin HOWTO |
| 2 | ||
| 3 | @section Introduction | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
4 | C plugins are native plugins. They have complete access to all of the API, |
| 10468 | 5 | and can do basically whatever they want. All of the protocol plugins, as |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
6 | well as the Mono, Perl, and Tcl loader plugins are written in C. |
| 10468 | 7 | |
| 8 | @section getting_started Getting Started | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
9 | 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
|
10 | 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
|
11 | 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
|
12 | 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
|
13 | to use a new feature. Please do not abuse our Mercurial repository, however. |
| 10468 | 14 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
15 | All plugins must have @c PURPLE_PLUGINS defined and the definition must be |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
16 | before including any libpurple, Pidgin, or Finch header files. Failure to do |
|
34964
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
17 | so can lead to strange errors that are hard to diagnose. Including purple.h |
|
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
18 | will define this for you. |
| 10468 | 19 | |
| 20 | @section hello_world Hello World! | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
21 | 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
|
22 | different? |
| 10468 | 23 | |
| 24 | @code | |
|
34964
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
25 | #include <purple.h> |
| 10468 | 26 | |
| 27 | static gboolean | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
28 | 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
|
29 | 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
|
30 | "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
|
31 | NULL, NULL, NULL, NULL); |
| 10468 | 32 | |
| 33 | return TRUE; | |
| 34 | } | |
| 35 | ||
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
36 | static PurplePluginInfo info = { |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
37 | PURPLE_PLUGIN_MAGIC, |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
38 | PURPLE_MAJOR_VERSION, |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
39 | PURPLE_MINOR_VERSION, |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
40 | PURPLE_PLUGIN_STANDARD, |
| 10468 | 41 | NULL, |
| 42 | 0, | |
| 43 | NULL, | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
44 | PURPLE_PRIORITY_DEFAULT, |
| 10468 | 45 | |
| 46 | "core-hello_world", | |
| 47 | "Hello World!", | |
| 48 | VERSION, | |
| 49 | ||
| 50 | "Hello World Plugin", | |
| 51 | "Hello World Plugin", | |
| 52 | NULL, | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
53 | "http://helloworld.tld", |
| 10468 | 54 | |
| 55 | plugin_load, | |
| 56 | NULL, | |
| 57 | NULL, | |
| 58 | ||
| 59 | NULL, | |
| 60 | NULL, | |
| 61 | NULL, | |
|
18789
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
62 | NULL, |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
63 | NULL, |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
64 | NULL, |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
65 | NULL, |
| 10468 | 66 | NULL |
| 67 | }; | |
| 68 | ||
| 69 | static void | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
70 | 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
|
71 | { |
| 10468 | 72 | } |
| 73 | ||
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
74 | PURPLE_INIT_PLUGIN(hello_world, init_plugin, info); |
| 10468 | 75 | |
| 76 | @endcode | |
| 77 | ||
|
34964
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
78 | Okay, so what does all this mean? We start off by including purple.h. This |
|
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
79 | file defines @c PURPLE_PLUGINS as described before so that we don't have to |
|
54ebd3dcae16
Simplified example plugins by including purple.h
Ankit Vani <a@nevitus.org>
parents:
34962
diff
changeset
|
80 | manually define it. It also includes all the libpurple header files. |
| 10468 | 81 | |
|
18789
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
82 | @c plugin_load is not required. It is called when the plugin is loaded so |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
83 | that you can initialize any variables and so on. In this plugin we'll just |
|
10469
3edb0348ba88
[gaim-migrate @ 11751]
Mark Doliner <markdoliner@pidgin.im>
parents:
10468
diff
changeset
|
84 | use it to display a message. |
| 10468 | 85 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
86 | Next we have the @c PurplePluginInfo structure. Every plugin MUST have one of |
| 10468 | 87 | these. Below is a code snipet of the same struct used in @c hello_world with |
| 88 | comments describing what each is. | |
| 89 | ||
| 90 | @code | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
91 | static PurplePluginInfo info = { |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
92 | 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
|
93 | PURPLE_PLUGIN_MAGIC. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
94 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
95 | 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
|
96 | 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
|
97 | 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
|
98 | 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
|
99 | cause problems. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
100 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
101 | 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
|
102 | 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
|
103 | 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
|
104 | 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
|
105 | 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
|
106 | 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
|
107 | 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
|
108 | 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
|
109 | 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
|
110 | 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
|
111 | 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
|
112 | 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
|
113 | 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
|
114 | 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
|
115 | 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
|
116 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
117 | 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
|
118 | 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
|
119 | 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
|
120 | 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
|
121 | 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
|
122 | 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
|
123 | FINCH_PLUGIN_TYPE. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
124 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
125 | 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
|
126 | 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
|
127 | 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
|
128 | 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
|
129 | list of plugins. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
130 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
131 | 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
|
132 | 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
|
133 | 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
|
134 | 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
|
135 | 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
|
136 | plugin_init function. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
137 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
138 | 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
|
139 | 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
|
140 | 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
|
141 | 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
|
142 | PURPLE_PRIORITY_LOWEST |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
143 | */ |
| 10468 | 144 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
145 | "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
|
146 | 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
|
147 | 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
|
148 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
149 | "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
|
150 | 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
|
151 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
152 | 1.1, /* This is the version of your plugin. */ |
| 10468 | 153 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
154 | "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
|
155 | 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
|
156 | 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
|
157 | this. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
158 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
159 | "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
|
160 | 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
|
161 | 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
|
162 | 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
|
163 | 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
|
164 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
165 | 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
|
166 | email address. |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
167 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
168 | "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
|
169 | 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
|
170 | report bugs, etc. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
171 | */ |
| 10468 | 172 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
173 | 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
|
174 | 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
|
175 | plugin. It should be of the type: |
| 10468 | 176 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
177 | gboolean plugin_load(PurplePlugin *plugin) |
| 10468 | 178 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
179 | 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
|
180 | 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
|
181 | 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
|
182 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
183 | 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
|
184 | 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
|
185 | should be of the type: |
| 10468 | 186 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
187 | gboolean plugin_unload(PurplePlugin *plugin) |
| 10468 | 188 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
189 | 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
|
190 | 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
|
191 | 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
|
192 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
193 | 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
|
194 | 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
|
195 | 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
|
196 | 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
|
197 | 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
|
198 | be of the type: |
| 10468 | 199 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
200 | 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
|
201 | */ |
| 10468 | 202 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
203 | 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
|
204 | 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
|
205 | 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
|
206 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
207 | 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
|
208 | 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
|
209 | 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
|
210 | 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
|
211 | */ |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
212 | 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
|
213 | 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
|
214 | 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
|
215 | 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
|
216 | code in: |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
217 | 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
|
218 | */ |
|
18789
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
219 | 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
|
220 | "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
|
221 | 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
|
222 | type: |
| 10468 | 223 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
224 | 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
|
225 | gpointer context) |
| 10468 | 226 | |
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
227 | 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
|
228 | PurplePluginActions. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
229 | */ |
|
18789
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
230 | 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
|
231 | 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
|
232 | need it. |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
233 | */ |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
234 | 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
|
235 | 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
|
236 | need it. |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
237 | */ |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
238 | 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
|
239 | 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
|
240 | need it. |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
241 | */ |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
242 | 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
|
243 | 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
|
244 | need it. |
|
f7a51d12abc0
Patch from John Bailey (rekkanoryo) to update the C Howto.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16260
diff
changeset
|
245 | */ |
| 10468 | 246 | }; |
| 247 | @endcode | |
| 248 | ||
|
16260
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
249 | Finally we have @c init_plugin and @c PURPLE_INIT_PLUGIN. @c init_plugin is |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
250 | 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
|
251 | will add their preferences to the pref tree here--more about that later. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
252 | @c PURPLE_INIT_PLUGIN is a macro that EVERY plugin MUST have. |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
253 | @c PURPLE_INIT_PLUGIN tells libpurple some very basic things about your |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
254 | plugin, like what name to use if the plugin is compiled staticly, the |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
255 | @c init_plugin function, and the name of the PurplePluginInfo structure. As |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
256 | you may have guessed, this also gets read when libpurple is probing your |
|
3e2e3df543f0
Effect the rename in the C-HOWTO and clean it up.
Richard Laager <rlaager@pidgin.im>
parents:
15864
diff
changeset
|
257 | plugin. If this is missing, the plugin will not load. |
| 10468 | 258 | */ |
|
20897
2608e9e07913
Add some links from signal documentation back to the documentation for the
Will Thompson <resiak@pidgin.im>
parents:
18789
diff
changeset
|
259 | // vim: syntax=c.doxygen |