ApexDC++ Plugin SDK

Self Development Kits for Client software.

ApexDC++ | RSX++
Locked
Toast

ApexDC++ Plugin SDK

Post by Toast » 25 Mar 2008, 07:54

With 1.0.0 Final we introduced a new feature which allows users to extend ApexDC functionality through plugins. Now as wonderful as this sounds there is a slight but... you see no plugins exists as of yet. This is where you and your creative minds kick in, we provide you with the basic information about how to create plugin and in exchange you make plugins (sounds great, doesn't it?).

I. What you can and can't do?

Those of you who know how ApexDC source code is laid out know that it has two basic parts core and gui and out of these two plugins work mostly in the core part... so no you can't create that sidebar you always wanted in apex as a plugin. However, you can do a lot on the core side as well. Here are some simple ideas that could be created as a plugin:
  • More of those lovely client side chat commands, such as /winamp or /define (even to the extent of user editable list)
  • Answering machine (for PM's)
  • Chat/PM filtering
  • Primitive hub link
  • Cross hub announcer (useful for hub networks)
II. How does it work?

Plugins should be created as C++ dll files which implement a class derived from PluginStructure and export the following functions:

Code: Select all

double __cdecl getVer(); // Must return API version, which is defined as API_VER in the PluginStructure.h
char* __cdecl getGuid(); // Must return unique GUID/UUID for plugin (project specific, use guidgen.exe or guidgen.com)
PluginStructure* __cdecl getObject(); // Creates plugin interface
void __cdecl freeObject(); // Frees the instance created by getObject()
There exists a sample plugin project in the ApexDC source distribution which shows how this is done in practice and we suggest anyone creating their first plugin use that as base and work from it to get all of the base code right (don't forget to change GUID).

III. PluginStructure.h what, where, how?

PluginStructure.h (located in client folder of the source distribution) is the file which defines all of the classes that are passed back and forth plugins and ApexDC... or to be more specific their interfaces, which are like skeletons that usually consists purely virtual function declarations. To put it short and simple, you do not edit this file at all even though it is the one file which makes your dll file ApexDC plugin.

Although this file is strictly read-only for plugin developers they should read it through to get a good picture about what tools the have to interact with ApexDC and what functions ApexDC calls and when. The file is well commented so it should be relatively easy to understand what everything does.

Here is a quick overview of the classes defined in this file, and their purpose:
PluginCallBackInterface: Functions that plugins can call to interact with ApexDC++, see PluginStructure::getCallBack()
UserInterface: Provides functions to get information and interact with a user.
ClientInterface: Provides functions to get information and interact with a hub.
ConnectionInterface: Provides functions to get information and interact with a client<->client connection
PluginStructure: Plugin base class, provides functions which are called by ApexDC when certain event occurs.

IV. Important Notes

Build environment
Setup used to compile plugin has same requirements as compiling ApexDC++ itself.

Plugin licensing
Plugins are automatically licensed under GNU General Public License (or GPL). Why? Because to successfully create a plugin you need a file which is part of ApexDC, and which thus is under GNU GPL and as long as your project uses GPL'ed code it is automatically required to be licensed under GPL or you have violated the licensing terms which apply to the part of code which is under GPL license.

Toast

Re: ApexDC++ Plugin SDK

Post by Toast » 28 Apr 2008, 14:59

here is the sample plugin source
Attachments
apexdcpp_1.01_sample_plugin.rar
(6.32 KiB) Downloaded 488 times

Locked