This section will describe the general ways that ACDSee interacts with your plug-in. This will include the general Load/Unload workflow, as well as plug-in type-specific workflows.
After a plug-in is loaded, and before any other function is called, the Init function will be callled by ACDSee. For instance, after ACDSee loads a Command Extension plug-in, it must call CX_Init before it will call any other function.
After the Init function is called, ACDSee will also call the GetPlugInInfo function to determine what kinds of files, filters, etc. the plug-in supports. Additionally, if a plug-in has exported the Free function, then ACDSee will call it just before it unloads the plug-in, as long as Init has also been called.
As an example, suppose ACDSee wants to use a filter plug-in to apply a filter to an image. The first two functions called would be IF_Init and IF_GetPlugInInfo. The last function call would be IF_Free.
There are some functions that are common across all plug-in types which may be called at any time during plug-in execution. They are: ErrorHandler, Help, and ShowPlugInDialog. These are for handling plug-in errors, showing a help document for the plug-in, and showing an about/settings dialog for the plug-in.
Here is an example usage of a plug-in:
Below are some type-specific call orders for each type of plug-in. It is assumed that the appropriate initialization functions have been called in each of the examples. (See above.)
Invoke a plug-in command:
|
The host usually passes user input to the plug-in until the function returns. |
Decode an image with metadata:
|
Opens the image. |
|
Retrieves information about the image. |
|
Obtains page-specific information. |
|
Starts decoding the image. |
|
Calls until the image is fully decoded. |
|
Calls when the image has been decoded. |
|
Retrieves image metadata. |
|
Closes the image. |
|
The plug-in should free the memory allocated during ID_GetMetadata. |
Get pixel formats:
|
Gets the valid pixel formats for a supported image format. |
Encode an image:
|
Obtains default encoding parameters for the image format to be written to. |
|
Instructs the plug-in to show a dialog allowing the user to customize encoding parameters. |
|
Starts encoding the image. |
|
Calls each time a page should be encoded. |
|
Finishes encoding the image. |
Invoke a filter from ACDSee's GUI:
|
Invokes a plug-in filter from ACDSee's UI. |
Invoke a plug-in filter from a menu while (optionally) recording an action:
|
Plug-in creates its own UI in a modal dialog. User sets parameters. User finishes with the plug-in UI and the filter is run on the image. Plug-in returns selected parameters to ACDSee. |
|
Plug-in frees the parameter array it returned in the previous function call. |
ACDSee Actions playback:
|
Called during action playback. Plug-in runs the specified filter using a copy of the parameter array it returned from IF_RunMenuFilter. |