At first, you can found ExampleDocklet in Plugins\ folder. There is XWDAPI.h/.cpp, [project name].def, main.cpp
So, first of all, look at XWDAPI.h. There are 2 functions:
1.
XWDBool XWDAPICALL XWDExec(XWDFunction function, ...);2.
XWDError XWDAPICALL XWDGetLastError();
As you can see, calling XWDGetLastError, to get detail infromation, it makes sense if XWDExec returns XWDFalse. I think there is no problems with it.
What about XWDExec. This is the main function, which contains all API.
XWDFunction function - you can found this enumeration just above XWDExec's implementation in XWDAPI.h.
Look at it carefully. For example:
XWDGetRootPath,
/*
Return path of the dock
XWDString - result
*/It means, that to get root folder of XWDock in your plugin you should do following:XWDString buff;
XWDBool ret = XWDExec(XWDGetRootPath, buff);
if(ret == XWDTrue)
{
// here we have, for example, buff = L"C:\\Program Files\\XWindows Dock\\";
}The main idea, it's to use Unicode and call all API using the same way (same function XWDExec);
What about a plugin's structure
In .def file you can found these functions:
XWDGetPluginType XWDGetPluginIcon XWDGetPluginInformation XWDPluginInitialize XWDPluginDeinitialize XWDPluginEvent
It's also very easy to understand how it works.
1. XWDGetPluginType - just return one of the constants, that describe what destination of your plugin.
2. XWDGetPluginIcon - fill XWDString buff in your icon's name (.ico, .png...) without full path, only name and return XWDTrue if your plugin has the icon, otherwise return XWDFalse.
3. XWDGetPluginInformation - XWDock calls this function when it needs to get to know more details about your plugin (its author, description, version and so on)
4. XWDPluginInitialize - has only one parameter, XWDId id - it's an unique identificator of your plugin. Also, if you want to store your own data, return a pointer on it as a result of the function.
5. XWDPluginDeinitialize - calls when plugin must be shutdown, here you must free your all resources
6. XWDPluginEvent - it's a callback from XWDock to your plugin. Use XWDEvent uEvent - to get to know what happened, and va_list args to get additional parameters (see XWDEvent enumeration).
So, feel free to ask me about new functionality for XWD API, I will be glad to discuss it with you.










