PICA, a plug-in manager for Adobe applications, provides the plug-in infrastructure, with basic tools and utilities for working with function suites and interacting with the file system.
A PICA plug-in must have a valid Plug-in Property List (�PiPL�) resource and it must have a code entry point described by the PiPL. A �PiPL� resource contains information about the plug-in�s type and how it is to be called. PICA will only consider files with PiPL resources to be potential plug-ins. The entry point of the plug-in code is specified in the PiPL resource. The entry point is called with a variety of messages telling it actions to take. By convention, the plug-in entry point is a C function called PluginMain
. For example:
Three arguments are passed to the plug-in entry point, collectively they make up a message. The first two parameters are C style strings identifying the message action, describing what the plug-in is supposed to do, see Plug-in Callers and Plug-in Selectors. The third parameter is a pointer to a data structure, which varies depending on the message action. The function returns an error code when it completes.
An application�s API is composed of callback functions organized into suites. Before a plug-in can use a function that is part of a suite, the suite containing it must first be acquired. A function suite is a structure (a C struct) filled with function pointers and when a plug-in acquires a suite, a pointer to this structure is returned. When the function suite is no longer needed, the acquired suite is released. It is important to do this so that the PICA manager can run optimally. For instance, PICA keeps track of how many times a suite has been acquired. If a suite added by plug-in is no longer in use (its reference count is 0), the plug-in may be unloaded to free memory. See SPBasicSuite for more information.
- See also:
- Plug-in Callers, Plug-in Selectors, Plug-in Notifiers, Error Return Codes, SPBasicSuite