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.

Changes between Version 1 and Version 2 of CHowTo/BasicPluginHowto


Ignore:
Timestamp:
Jul 16, 2007, 1:27:11 AM (17 years ago)
Author:
John Bailey
Comment:

Some tweaking.

Legend:

Unmodified
Added
Removed
Modified
  • CHowTo/BasicPluginHowto

    v1 v2  
    1 = C Plugin How-To =
     1= Basic C Plugin How-To =
    22
    33[[TOC(inline,noheading)]]
    44
    55== 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?
     6This 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?
    77
    88As 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.
     
    7979    "Hello World Plugin",         
    8080    "Hello World Plugin",         
    81     NULL,                         
     81    "My Name <email@helloworld.tld>",                         
    8282    "http://helloworld.tld",     
    8383   
     
    180180                               how much to display). */
    181181
    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
    183183                                         address. */
    184184
     
    251251
    252252== 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.
     253Now 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! ==
     256Consider 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!