Callbacks and Callback Suites

Plug-in hosts execute plug-in modules by calling the module’s main entry point, passing a selector, parameter block, and pointer to the module’s data.

Plug-in modules can make calls back to the plug-in host by means of callback function pointers that are provided in the plug-in’s parameter block. These callbacks provide specific services that your plug-in module may need.

Some of these callback routines are new and may not be provided by other plug-in hosts, including earlier versions of Photoshop. If a host does not provide a particular routine or suite, the relevant pointer will be NULL.

Photoshop 3.0 and above includes an error code to indicate that the host does not supply necessary functionality:

    #define errPlugInHostInsufficient  -30900

Under the Mac OS, callback functions use Pascal calling conventions; Windows callbacks use C calling conventions, indicated by the macro "MACPASCAL".

Callbacks fall into three categories:

  • Non-Suite Callbacks
    Callback pointers that are hard-coded into the parameter block structures. These are usually given the name of direct, or non-suite callbacks. These are described in Using Non-Suite Callbacks.
  • Photoshop Standard Callback Suites
    Callbacks that are accessed through callback suite pointers that are hard coded into the parameter block structures. In this case, the suite pointer allows access to multiple callback functions. These are usually given the name of "Standard Suites". These are described in Using Photoshop Standard Callback Suites.
  • PICA Callback Suites
    Callbacks that are accessed through the Adobe Plug-in Component Architecture (PICA). The plug-in accesses these callbacks by acquiring a suite from the PICA Basic Suite, sSPBasic. Every plug-in has access to the PICA Basic suite either through a pointer in its parameter block, or through a message passed by the host to the entry point of the plug in. These are described in Using PICA Callback Suites.
Note:
Some suites have both Standard Suite and PICA Suite definitions, such as for Buffer Suite. In these cases, Standared Suite definition has been deprecated, and is available only for backward compatibility.