Trac is being migrated to new services! Issues can be found in our new
YouTrack instance and WIKI pages can be found on our
website.
- Timestamp:
-
Jul 16, 2007, 1:27:11 AM (17 years ago)
- Author:
-
John Bailey
- Comment:
-
Some tweaking.
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
1 | | = C Plugin How-To = |
| 1 | = Basic C Plugin How-To = |
2 | 2 | |
3 | 3 | [[TOC(inline,noheading)]] |
4 | 4 | |
5 | 5 | == Introduction == |
6 | | This How-To document is designed to provide a basic overview of writing a plugin for Pidgin, Finch, and/or libpurple in our native language, C. We'll start with a basic "Hello, World!" plugin and go from there. Let's dig in, shall we? |
| 6 | This How-To document is designed to provide a basic overview of writing a plugin for Pidgin, Finch, and/or libpurple in our native language, C. We'll write a basic "Hello, World!" plugin. Let's dig in, shall we? |
7 | 7 | |
8 | 8 | As we've already stated, C plugins are native plugins. They have complete access to all of the API provided by Pidgin, Finch, and libpurple. This means that a C plugin can do basically anything it wants to do. All our protocol plugins and our loader plugins (Mono, Perl, and Tcl) are written in C. |
… |
… |
|
79 | 79 | "Hello World Plugin", |
80 | 80 | "Hello World Plugin", |
81 | | NULL, |
| 81 | "My Name <email@helloworld.tld>", |
82 | 82 | "http://helloworld.tld", |
83 | 83 | |
… |
… |
|
180 | 180 | how much to display). */ |
181 | 181 | |
182 | | "My Name <email@helloworld.tld">, /* This is where you can put your name and e-mail |
| 182 | "My Name <email@helloworld.tld>", /* This is where you can put your name and e-mail |
183 | 183 | address. */ |
184 | 184 | |
… |
… |
|
251 | 251 | |
252 | 252 | == Compile, Install, and Load the Hello, World! Plugin == |
253 | | Now that we have a complete plugin source file, we need to compile it. From `~/development/pidgin-2.0.2/libpurple/plugins`, run `make helloworld.so` (if using Windows, `make -f Makefile.mingw helloworld.dll`). If you copied and pasted the code correctly, this should compile without incident. You can move the resulting .so file to ~/.purple/plugins (move the resulting .dll file to `%APPDATA%\.purple\plugins` on Windows). Now when you open the Plugins dialog in Pidgin or Finch, the plugin should show up. When you load it you should see a message pop up. |
| 253 | Now that we have a complete plugin source file, we need to compile it. From `~/development/pidgin-2.0.2/libpurple/plugins`, run `make helloworld.so` (if using Windows, `make -f Makefile.mingw helloworld.dll`). If you copied and pasted the code correctly, this should compile without incident. You can move the resulting .so file to `~/.purple/plugins` (move the resulting .dll file to `%APPDATA%\.purple\plugins` on Windows). Now when you open the Plugins dialog in Pidgin or Finch, the plugin should show up. When you load it you should see a message pop up. |
| 254 | |
| 255 | == Going Beyond Hello, World! == |
| 256 | Consider C Plugins 101 complete. We have more to get to in this tutorial, though, starting with C Plugins 102: [wiki:CHowTo/PluginActionsHowTo Plugin Actions]. |
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!