WIM:Plugin API
From WIM
Contents |
This page is a work in progress for the developement of WIM Plugins.
Over the course of the beta period of WIM's Plugin system, this page will continually be updated to provide developers documentation on creating WIM Plugins.
If you have any suggestions for the system, please post a message in the developer forums.
[edit] About WIM Plugins
Your plugin is created as just as if your are creating a normal addon. You are free to do what you wish as far as that is concerned. What I have provided you is simply an easier way to tie your addon into WIM.
You should however included WIM as a dependency in your TOC file otherwise you must do your own checks to ensure that WIM is loaded prior to registering your plugin. This may seem obvious to most, but you never know.
Just a note, the WIM API is still available and still holds true if needed.
[edit] Plugin Information Table
- version - The version number of your plugin.
- optionsFrame - The option frame that you want loaded into WIM's plugin screen. (Pass as object).
- interceptInboundFunction - The name (as string) of the function you want to handle intercepting of incoming whispers.
- interceptOutboundFunction - The name (as string) of the function you want to handle intercepting of outbound whispers.
- description - description of your plugin.
NOTE: the only required value is version.
Example:
myPluginInfo = {
version = "1.0.0",
description = "This is my plugin. Thank you for using it.",
optionsFrame = myPluginOptionFrame,
interceptInboundFunction = "myPlugin_InterceptIncoming",
interceptOutboundFunction = "myPlugin_InterceptOutbound"
};
[edit] Registering Plugin with WIM
In order for WIM to recognize your plugin, you must register it first using the WIM_RegisterPlugin function.
[edit] WIM_RegisterPlugin(pluginName, pluginInfoTable, requiredVersion)
- Parameters
- pluginName - The name display name of your plugin. (Ex. "My Plugin").
- pluginInfoTable - the table listed above.
- requiredVersion - the required version of WIM needed to run your plugin.
All parameters are required. If WIM detects a problem with your register request, it will display an error message.
Example:
myPluginInfo = {
version = "1.0.0",
optionsFrame = myPluginOptionFrame,
interceptInboundFunction = "myPlugin_InterceptIncoming",
interceptOutboundFunction = "myPlugin_InterceptOutbound"
};
WIM_RegisterPlugin("My Plugin", myPluginInfo, "2.1.0");
[edit] Available Functions
These functions were added for the main purpose of having your plugin interact with WIM. These are considered safe are not likely to be changed in future versions.
[edit] WIM_PassIncomingMessage(theUser, theMSG)
This function should be used in conjunction with your intercept function for incoming whispers. Once you have performed your required changes/checks, you can then return this message event to WIM by calling this function.
[edit] WIM_PassOutgoingMessage(theUser, theMSG)
This function should be used in conjunction with your intercept function for outbound whispers. Once you have performed your required changes/checks, you can then return this message event to WIM by calling this function. NOTE: this does not alter the message sent to the other user. This function only effects how WIM displays this event.

